From cb80c93d6105da4de9196902cf9dfc38fa5302e9 Mon Sep 17 00:00:00 2001 From: linju Date: Thu, 10 Dec 2020 18:17:05 +0800 Subject: [PATCH] opendb-contacts --- collection/opendb-contacts/collection.json | 65 ++++++++++++++++++++++ collection/opendb-contacts/data.json | 7 +++ collection/opendb-contacts/package.json | 17 ++++++ 3 files changed, 89 insertions(+) create mode 100644 collection/opendb-contacts/collection.json create mode 100644 collection/opendb-contacts/data.json create mode 100644 collection/opendb-contacts/package.json diff --git a/collection/opendb-contacts/collection.json b/collection/opendb-contacts/collection.json new file mode 100644 index 0000000..4cfdae2 --- /dev/null +++ b/collection/opendb-contacts/collection.json @@ -0,0 +1,65 @@ +{ + "schema": { + "bsonType": "object", + "permission": { + ".read": true, + ".create": true, + ".update": true, + ".delete": true + }, + "required": ["username", "mobile"], + "properties": { + "_id": { + "description": "存储文档 ID(用户 ID),系统自动生成" + }, + "username": { + "bsonType": "string", + "title": "用户名", + "description": "用户名,不允许重复", + "order":1 + }, + "gender": { + "bsonType": "int", + "title": "性别", + "description": "用户性别:0 未知 1 男性 2 女性", + "order":2, + "defaultValue": 0, + "enum": [{ + "text": "未知", + "value": 0 + }, + { + "text": "男", + "value": 1 + }, + { + "text": "女", + "value": 2 + } + ] + }, + "mobile": { + "bsonType": "string", + "title": "手机号码", + "order":3, + "description": "手机号码", + "pattern": "^\\+?[0-9-]{3,20}$" + }, + "email": { + "bsonType": "string", + "format": "email", + "title": "邮箱", + "order":4, + "description": "邮箱地址" + }, + "comment": { + "bsonType": "string", + "title": "备注", + "order":5, + "description": "备注" + } + } + }, + "index": [] +} + diff --git a/collection/opendb-contacts/data.json b/collection/opendb-contacts/data.json new file mode 100644 index 0000000..eea3869 --- /dev/null +++ b/collection/opendb-contacts/data.json @@ -0,0 +1,7 @@ +[{ + "gender": 0, + "username": "林举", + "mobile": "18888888888", + "email": "630033903@qq.com", + "comment": "" +}] \ No newline at end of file diff --git a/collection/opendb-contacts/package.json b/collection/opendb-contacts/package.json new file mode 100644 index 0000000..813a955 --- /dev/null +++ b/collection/opendb-contacts/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/opendb-contacts", + "version": "0.0.1", + "description": "opendb-contacts", + "keywords": ["opendb-contacts"], + "opendb": { + "title": "通讯录", + "type": "collection", + "contributors": [ + { + "name": "DCloud_linju", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} \ No newline at end of file