add opendb-notice-comment

This commit is contained in:
linju 2023-10-23 20:43:45 +08:00
parent 86d82f56d8
commit 5404566751
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,48 @@
{
"schema": {
"bsonType": "object",
"required": ["notice_id"],
"permission": {
"read": "doc.state == 1 || auth.uid == doc.user_id",
"create": "auth.uid != null",
"update": false,
"delete": "auth.uid == doc.user_id"
},
"properties": {
"_id": {
"description": "ID系统自动生成"
},
"notice_id": {
"description": "通知的id",
"foreignKey": "opendb-notice._id"
},
"text": {
"bsonType": "string"
},
"user_id": {
"forceDefaultValue": {
"$env": "uid"
},
"foreignKey": "uni-id-users._id"
},
"ip": {
"forceDefaultValue": {
"$env": "clientIP"
}
},
"create_time": {
"forceDefaultValue": {
"$env": "now"
}
},
"state": {
"bsonType": "int",
"defaultValue": 0,
"permission": {
"write": "'AUDITOR' in auth.role"
}
}
}
},
"index": []
}

View File

@ -0,0 +1 @@
[]

View File

@ -0,0 +1,17 @@
{
"name": "@opendb/opendb-notice-comment",
"version": "0.0.1",
"description": "关于通知的评论",
"keywords": ["关于通知的评论"],
"opendb": {
"title": "关于通知的评论",
"type": "collection",
"contributors": [
{
"name": "DCloud",
"email": "service@dcloud.io",
"homepage": "https://gitee.com/dcloud/opendb"
}
]
}
}