From 54045667517cf8d41b4b283a8a9422183653d4a4 Mon Sep 17 00:00:00 2001 From: linju Date: Mon, 23 Oct 2023 20:43:45 +0800 Subject: [PATCH] add opendb-notice-comment --- .../opendb-notice-comment/collection.json | 48 +++++++++++++++++++ collection/opendb-notice-comment/data.json | 1 + collection/opendb-notice-comment/package.json | 17 +++++++ 3 files changed, 66 insertions(+) create mode 100644 collection/opendb-notice-comment/collection.json create mode 100644 collection/opendb-notice-comment/data.json create mode 100644 collection/opendb-notice-comment/package.json diff --git a/collection/opendb-notice-comment/collection.json b/collection/opendb-notice-comment/collection.json new file mode 100644 index 0000000..48878e7 --- /dev/null +++ b/collection/opendb-notice-comment/collection.json @@ -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": [] +} diff --git a/collection/opendb-notice-comment/data.json b/collection/opendb-notice-comment/data.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/collection/opendb-notice-comment/data.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/collection/opendb-notice-comment/package.json b/collection/opendb-notice-comment/package.json new file mode 100644 index 0000000..61f43ca --- /dev/null +++ b/collection/opendb-notice-comment/package.json @@ -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" + } + ] + } +}