diff --git a/collection/opendb-admin-log/collection.json b/collection/opendb-admin-log/collection.json index b996bf9..eee6259 100644 --- a/collection/opendb-admin-log/collection.json +++ b/collection/opendb-admin-log/collection.json @@ -1,13 +1,13 @@ { "schema": { "bsonType": "object", - "required": ["user_id","content"], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, + "required": ["user_id", "content"], + "permission": { + "read": false, + "create": false, + "update": false, + "delete": false + }, "properties": { "_id": { "description": "ID,系统自动生成" @@ -16,25 +16,31 @@ "bsonType": "string", "description": "用户id,参考uni-id-users表" }, - "user_name": { - "bsonType": "string", - "description": "用户名或昵称,冗余设计", - "title":"用户" - }, + "user_name": { + "bsonType": "string", + "description": "用户名或昵称,冗余设计", + "title": "用户" + }, "content": { "bsonType": "string", "description": "日志内容,如:修改密码", - "title":"内容" + "title": "内容" }, "ip": { "bsonType": "string", "description": "ip地址", - "title": "IP" + "title": "IP", + "forceDefaultValue": { + "$env": "clientIP" + } }, "create_date": { "bsonType": "timestamp", "description": "创建时间", - "title": "时间" + "title": "时间", + "forceDefaultValue": { + "$env": "now" + } } } }, diff --git a/collection/opendb-admin-menus/collection.json b/collection/opendb-admin-menus/collection.json index ddbbdb9..1462624 100644 --- a/collection/opendb-admin-menus/collection.json +++ b/collection/opendb-admin-menus/collection.json @@ -43,7 +43,10 @@ }, "create_date": { "bsonType": "timestamp", - "description": "菜单创建时间" + "description": "菜单创建时间", + "forceDefaultValue": { + "$env": "now" + } } } }, diff --git a/collection/opendb-news-favorite/collection.json b/collection/opendb-news-favorite/collection.json index 86d9680..e697029 100644 --- a/collection/opendb-news-favorite/collection.json +++ b/collection/opendb-news-favorite/collection.json @@ -3,10 +3,10 @@ "bsonType": "object", "required": ["user_id", "article_id"], "permission": { - "read": true, - "create": "auth.uid != null", + "read": true, + "create": "auth.uid != null", "update": false, - "delete": "doc.uid == auth.uid" + "delete": "doc.uid == auth.uid" }, "properties": { "_id": { @@ -15,7 +15,7 @@ "article_id": { "bsonType": "string", "description": "文章id,参考opendb-news-articles表", - "foreignKey":"opendb-news-articles._id" + "foreignKey": "opendb-news-articles._id" }, "user_id": { "bsonType": "string", @@ -23,30 +23,30 @@ "forceDefaultValue": { "$env": "uid" }, - "foreignKey":"uni-id-users._id" + "foreignKey": "uni-id-users._id" }, "create_date": { "bsonType": "timestamp", - "description": "收藏时间" + "description": "收藏时间", + "forceDefaultValue": { + "$env": "now" + } } } }, - "index": [ - { - "IndexName": "article_user_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "article_id", - "Direction": "1" - }, - { - "Name": "user_id", - "Direction": "1" - } - ], - "MgoIsUnique": true - } + "index": [{ + "IndexName": "article_user_", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "article_id", + "Direction": "1" + }, + { + "Name": "user_id", + "Direction": "1" + } + ], + "MgoIsUnique": true } - ] + }] } diff --git a/collection/uni-id-address/collection.json b/collection/uni-id-address/collection.json index 79383c9..8b68a6b 100644 --- a/collection/uni-id-address/collection.json +++ b/collection/uni-id-address/collection.json @@ -12,43 +12,53 @@ }, "name": { "bsonType": "string", - "description": "收货人" + "description": "收货人", + "title": "收货人" }, "alias": { "bsonType": "string", - "description": "别名,例如:家里、公司" + "description": "别名,例如:家里、公司", + "title": "别名" }, "mobile": { "bsonType": "string", - "description": "手机号码,加密存储" + "description": "手机号码,加密存储", + "title": "手机号" }, "mobile_area_code": { "bsonType": "string", - "description": "国际区号,中国大陆为 +86" + "description": "国际区号,中国大陆为 +86", + "title": "国际区号" }, "telephone": { "bsonType": "string", - "description": "电话" + "description": "电话", + "title": "电话" }, "telephone_area_code": { "bsonType": "string", - "description": "电话区号" + "description": "电话区号", + "title": "电话区号" }, "province_code": { "bsonType": "string", - "description": "省级编码" + "description": "省级编码", + "title": "省" }, "city_code": { "bsonType": "string", - "description": "地级编码" + "description": "地级编码", + "title": "市" }, "area_code": { "bsonType": "string", - "description": "区级编码" + "description": "区级编码", + "title": "区" }, "address": { "bsonType": "string", - "description": "详细信息" + "description": "详细信息", + "title": "详细信息" }, "formatted_address": { "bsonType": "string", @@ -56,15 +66,18 @@ }, "zip_code": { "bsonType": "string", - "description": "邮编" + "description": "邮编", + "title": "邮编" }, "email": { "bsonType": "string", - "description": "邮箱" + "description": "邮箱", + "title": "邮箱" }, "default": { "bsonType": "bool", - "description": "是否为默认地址" + "description": "是否为默认地址", + "title": "默认地址" } } }, diff --git a/collection/uni-id-device/collection.json b/collection/uni-id-device/collection.json index 24e5e0c..a4e633c 100644 --- a/collection/uni-id-device/collection.json +++ b/collection/uni-id-device/collection.json @@ -32,7 +32,10 @@ }, "create_date": { "bsonType": "timestamp", - "description": "创建时间" + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } }, "last_active_date": { "bsonType": "timestamp", diff --git a/collection/uni-id-log/collection.json b/collection/uni-id-log/collection.json index bbddf84..78a7189 100644 --- a/collection/uni-id-log/collection.json +++ b/collection/uni-id-log/collection.json @@ -29,7 +29,10 @@ }, "create_date": { "bsonType": "timestamp", - "description": "创建时间" + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } } } }, diff --git a/collection/uni-id-scores/collection.json b/collection/uni-id-scores/collection.json index b2635ba..563df51 100644 --- a/collection/uni-id-scores/collection.json +++ b/collection/uni-id-scores/collection.json @@ -29,7 +29,10 @@ }, "create_date": { "bsonType": "timestamp", - "description": "创建时间" + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } } } }, diff --git a/collection/uni-id-task-log/collection.json b/collection/uni-id-task-log/collection.json index 78d0522..47a9fe2 100644 --- a/collection/uni-id-task-log/collection.json +++ b/collection/uni-id-task-log/collection.json @@ -9,12 +9,12 @@ "user_id": { "bsonType": "string", "description": "用户id,参考uni-id-users表", - "foreignKey":"uni-id-users._id" + "foreignKey": "uni-id-users._id" }, "task_id": { "bsonType": "string", "description": "任务ID", - "foreignKey":"uni-id-task._id" + "foreignKey": "uni-id-task._id" }, "result": { "bsonType": "bool", @@ -26,7 +26,10 @@ }, "create_date": { "bsonType": "timestamp", - "description": "创建时间" + "description": "创建时间", + "forceDefaultValue": { + "$env": "now" + } } } },