update: 完善默认值,适配表单生成

This commit is contained in:
handongxun 2020-11-23 17:39:09 +08:00
parent 4504a79e1a
commit 86d1450dc0
8 changed files with 92 additions and 58 deletions

View File

@ -1,13 +1,13 @@
{ {
"schema": { "schema": {
"bsonType": "object", "bsonType": "object",
"required": ["user_id","content"], "required": ["user_id", "content"],
"permission": { "permission": {
"read": false, "read": false,
"create": false, "create": false,
"update": false, "update": false,
"delete": false "delete": false
}, },
"properties": { "properties": {
"_id": { "_id": {
"description": "ID系统自动生成" "description": "ID系统自动生成"
@ -16,25 +16,31 @@
"bsonType": "string", "bsonType": "string",
"description": "用户id参考uni-id-users表" "description": "用户id参考uni-id-users表"
}, },
"user_name": { "user_name": {
"bsonType": "string", "bsonType": "string",
"description": "用户名或昵称,冗余设计", "description": "用户名或昵称,冗余设计",
"title":"用户" "title": "用户"
}, },
"content": { "content": {
"bsonType": "string", "bsonType": "string",
"description": "日志内容,如:修改密码", "description": "日志内容,如:修改密码",
"title":"内容" "title": "内容"
}, },
"ip": { "ip": {
"bsonType": "string", "bsonType": "string",
"description": "ip地址", "description": "ip地址",
"title": "IP" "title": "IP",
"forceDefaultValue": {
"$env": "clientIP"
}
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "创建时间", "description": "创建时间",
"title": "时间" "title": "时间",
"forceDefaultValue": {
"$env": "now"
}
} }
} }
}, },

View File

@ -43,7 +43,10 @@
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "菜单创建时间" "description": "菜单创建时间",
"forceDefaultValue": {
"$env": "now"
}
} }
} }
}, },

View File

@ -3,10 +3,10 @@
"bsonType": "object", "bsonType": "object",
"required": ["user_id", "article_id"], "required": ["user_id", "article_id"],
"permission": { "permission": {
"read": true, "read": true,
"create": "auth.uid != null", "create": "auth.uid != null",
"update": false, "update": false,
"delete": "doc.uid == auth.uid" "delete": "doc.uid == auth.uid"
}, },
"properties": { "properties": {
"_id": { "_id": {
@ -15,7 +15,7 @@
"article_id": { "article_id": {
"bsonType": "string", "bsonType": "string",
"description": "文章id参考opendb-news-articles表", "description": "文章id参考opendb-news-articles表",
"foreignKey":"opendb-news-articles._id" "foreignKey": "opendb-news-articles._id"
}, },
"user_id": { "user_id": {
"bsonType": "string", "bsonType": "string",
@ -23,30 +23,30 @@
"forceDefaultValue": { "forceDefaultValue": {
"$env": "uid" "$env": "uid"
}, },
"foreignKey":"uni-id-users._id" "foreignKey": "uni-id-users._id"
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "收藏时间" "description": "收藏时间",
"forceDefaultValue": {
"$env": "now"
}
} }
} }
}, },
"index": [ "index": [{
{ "IndexName": "article_user_",
"IndexName": "article_user_", "MgoKeySchema": {
"MgoKeySchema": { "MgoIndexKeys": [{
"MgoIndexKeys": [ "Name": "article_id",
{ "Direction": "1"
"Name": "article_id", },
"Direction": "1" {
}, "Name": "user_id",
{ "Direction": "1"
"Name": "user_id", }
"Direction": "1" ],
} "MgoIsUnique": true
],
"MgoIsUnique": true
}
} }
] }]
} }

View File

@ -12,43 +12,53 @@
}, },
"name": { "name": {
"bsonType": "string", "bsonType": "string",
"description": "收货人" "description": "收货人",
"title": "收货人"
}, },
"alias": { "alias": {
"bsonType": "string", "bsonType": "string",
"description": "别名,例如:家里、公司" "description": "别名,例如:家里、公司",
"title": "别名"
}, },
"mobile": { "mobile": {
"bsonType": "string", "bsonType": "string",
"description": "手机号码,加密存储" "description": "手机号码,加密存储",
"title": "手机号"
}, },
"mobile_area_code": { "mobile_area_code": {
"bsonType": "string", "bsonType": "string",
"description": "国际区号,中国大陆为 +86" "description": "国际区号,中国大陆为 +86",
"title": "国际区号"
}, },
"telephone": { "telephone": {
"bsonType": "string", "bsonType": "string",
"description": "电话" "description": "电话",
"title": "电话"
}, },
"telephone_area_code": { "telephone_area_code": {
"bsonType": "string", "bsonType": "string",
"description": "电话区号" "description": "电话区号",
"title": "电话区号"
}, },
"province_code": { "province_code": {
"bsonType": "string", "bsonType": "string",
"description": "省级编码" "description": "省级编码",
"title": "省"
}, },
"city_code": { "city_code": {
"bsonType": "string", "bsonType": "string",
"description": "地级编码" "description": "地级编码",
"title": "市"
}, },
"area_code": { "area_code": {
"bsonType": "string", "bsonType": "string",
"description": "区级编码" "description": "区级编码",
"title": "区"
}, },
"address": { "address": {
"bsonType": "string", "bsonType": "string",
"description": "详细信息" "description": "详细信息",
"title": "详细信息"
}, },
"formatted_address": { "formatted_address": {
"bsonType": "string", "bsonType": "string",
@ -56,15 +66,18 @@
}, },
"zip_code": { "zip_code": {
"bsonType": "string", "bsonType": "string",
"description": "邮编" "description": "邮编",
"title": "邮编"
}, },
"email": { "email": {
"bsonType": "string", "bsonType": "string",
"description": "邮箱" "description": "邮箱",
"title": "邮箱"
}, },
"default": { "default": {
"bsonType": "bool", "bsonType": "bool",
"description": "是否为默认地址" "description": "是否为默认地址",
"title": "默认地址"
} }
} }
}, },

View File

@ -32,7 +32,10 @@
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "创建时间" "description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
}, },
"last_active_date": { "last_active_date": {
"bsonType": "timestamp", "bsonType": "timestamp",

View File

@ -29,7 +29,10 @@
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "创建时间" "description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
} }
} }
}, },

View File

@ -29,7 +29,10 @@
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "创建时间" "description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
} }
} }
}, },

View File

@ -9,12 +9,12 @@
"user_id": { "user_id": {
"bsonType": "string", "bsonType": "string",
"description": "用户id参考uni-id-users表", "description": "用户id参考uni-id-users表",
"foreignKey":"uni-id-users._id" "foreignKey": "uni-id-users._id"
}, },
"task_id": { "task_id": {
"bsonType": "string", "bsonType": "string",
"description": "任务ID", "description": "任务ID",
"foreignKey":"uni-id-task._id" "foreignKey": "uni-id-task._id"
}, },
"result": { "result": {
"bsonType": "bool", "bsonType": "bool",
@ -26,7 +26,10 @@
}, },
"create_date": { "create_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"description": "创建时间" "description": "创建时间",
"forceDefaultValue": {
"$env": "now"
}
} }
} }
}, },