update opendb-department

This commit is contained in:
linju 2023-10-23 17:08:50 +08:00
parent 42b09d2b5b
commit 274e5897ac
2 changed files with 64 additions and 60 deletions

View File

@ -1,61 +1,65 @@
{ {
"schema": { "schema": {
"bsonType": "object", "bsonType": "object",
"required": ["name"], "required": ["name"],
"permission": { "permission": {
"read": true, "read": true,
"create": false, "create": false,
"update": false, "update": false,
"delete": false "delete": false
}, },
"properties": { "properties": {
"_id": { "_id": {
"description": "ID系统自动生成" "description": "ID系统自动生成"
}, },
"parent_id": { "parent_id": {
"bsonType": "string", "bsonType": "string",
"description": "父级部门ID", "description": "父级部门ID",
"parentKey": "_id" "parentKey": "_id"
}, },
"name": { "name": {
"bsonType": "string", "bsonType": "string",
"description": "部门名称", "description": "部门名称",
"title": "部门名称", "title": "部门名称",
"trim":"both" "trim": "both"
}, },
"level": { "level": {
"bsonType": "int", "bsonType": "int",
"description": "部门层级,为提升检索效率而作的冗余设计" "description": "部门层级,为提升检索效率而作的冗余设计"
}, },
"sort": { "sort": {
"bsonType": "int", "bsonType": "int",
"description": "部门在当前层级下的顺序,由小到大", "description": "部门在当前层级下的顺序,由小到大",
"title":"显示顺序" "title": "显示顺序"
}, },
"manager_uid":{ "manager_uid": {
"bsonType": "string", "bsonType": "string",
"description": "部门主管的userid 参考`uni-id-users` 表", "description": "部门主管的userid 参考`uni-id-users` 表",
"foreignKey": "uni-id-users._id" "foreignKey": "uni-id-users._id"
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "部门创建时间", "description": "部门创建时间",
"forceDefaultValue": { "forceDefaultValue": {
"$env": "now" "$env": "now"
} }
} },
} "status": {
}, "bsonType": "int",
"description": "部门状态0-正常、1-禁用"
}
}
},
"index": [ "index": [
{ {
"IndexName": "name", "IndexName": "name",
"MgoKeySchema": { "MgoKeySchema": {
"MgoIndexKeys": [{ "MgoIndexKeys": [{
"Name": "name", "Name": "name",
"Direction": "1" "Direction": "1"
}], }],
"MgoIsUnique": false "MgoIsUnique": false
} }
} }
] ]
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@opendb/opendb-department", "name": "@opendb/opendb-department",
"version": "0.1.0", "version": "0.1.1",
"description": "部门表", "description": "部门表",
"keywords": ["部门", "组织机构"], "keywords": ["部门", "组织机构"],
"opendb": { "opendb": {