From 61ef724818c931baf63f925c663faaad82801b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E7=BA=A2=E4=BF=9D?= Date: Sat, 9 Jan 2021 23:45:33 +0800 Subject: [PATCH] add opendb-department --- collection/opendb-department/collection.json | 61 ++++++++++++++++++++ collection/opendb-department/data.json | 1 + collection/opendb-department/package.json | 17 ++++++ database/opendb-admin/db_init.json | 3 +- database/uni-id/db_init.json | 3 +- 5 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 collection/opendb-department/collection.json create mode 100644 collection/opendb-department/data.json create mode 100644 collection/opendb-department/package.json diff --git a/collection/opendb-department/collection.json b/collection/opendb-department/collection.json new file mode 100644 index 0000000..2c80056 --- /dev/null +++ b/collection/opendb-department/collection.json @@ -0,0 +1,61 @@ +{ + "schema": { + "bsonType": "object", + "required": ["name"], + "permission": { + "read": true, + "create": false, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "parent_id": { + "bsonType": "string", + "description": "父级部门ID", + "parentKey": "_id" + }, + "name": { + "bsonType": "string", + "description": "部门名称", + "title": "部门名称", + "trim":"both" + }, + "level": { + "bsonType": "int", + "description": "部门层级,为提升检索效率而作的冗余设计" + }, + "sort": { + "bsonType": "int", + "description": "部门在当前层级下的顺序,由小到大", + "title":"显示顺序" + }, + "dep_manager":{ + "bsonType": "string", + "description": "部门主管的userid, 参考`uni-id-users` 表", + "foreignKey": "uni-id-users._id" + }, + "create_date": { + "bsonType": "timestamp", + "description": "部门创建时间", + "forceDefaultValue": { + "$env": "now" + } + } + } + }, + "index": [ + { + "IndexName": "name", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "name", + "Direction": "1" + }], + "MgoIsUnique": false + } + } + ] +} diff --git a/collection/opendb-department/data.json b/collection/opendb-department/data.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/collection/opendb-department/data.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/collection/opendb-department/package.json b/collection/opendb-department/package.json new file mode 100644 index 0000000..f0fa804 --- /dev/null +++ b/collection/opendb-department/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/opendb-department", + "version": "0.1.0", + "description": "部门表", + "keywords": ["部门", "组织机构"], + "opendb": { + "title": "部门表", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "service@dcloud.io", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/database/opendb-admin/db_init.json b/database/opendb-admin/db_init.json index 224681c..ba14a3e 100644 --- a/database/opendb-admin/db_init.json +++ b/database/opendb-admin/db_init.json @@ -1,4 +1,5 @@ { "opendb-admin-menus": {}, - "opendb-admin-log":{} + "opendb-admin-log":{}, + "opendb-department":{} } diff --git a/database/uni-id/db_init.json b/database/uni-id/db_init.json index 24e1ed9..f4f16af 100644 --- a/database/uni-id/db_init.json +++ b/database/uni-id/db_init.json @@ -10,5 +10,6 @@ "uni-id-task": {}, "uni-id-task-log": {}, "uni-id-followers": {}, - "opendb-verify-codes": {} + "opendb-verify-codes": {}, + "opendb-department":{} }