update: 表 opendb-news-articles 字段 article_status 改为 enum

This commit is contained in:
handongxun 2020-12-15 10:42:18 +08:00
parent 32929ff9b0
commit aafb5b9bcb

View File

@ -15,49 +15,57 @@
"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",
"defaultValue": { "defaultValue": {
"$env": "uid" "$env": "uid"
} }
}, },
"category_id": { "category_id": {
"bsonType": "string", "bsonType": "string",
"title":"分类", "title": "分类",
"description": "分类 id参考`uni-news-categories`表", "description": "分类 id参考`uni-news-categories`表",
"foreignKey":"opendb-news-categories._id", "foreignKey": "opendb-news-categories._id",
"enum": { "enum": {
"collection": "opendb-news-categories", "collection": "opendb-news-categories",
"field": "name as text, _id as value" "field": "name as text, _id as value"
} }
}, },
"title": { "title": {
"bsonType": "string", "bsonType": "string",
"title": "标题", "title": "标题",
"description": "标题", "description": "标题",
"label": "标题" "label": "标题"
}, },
"content": { "content": {
"bsonType": "string", "bsonType": "string",
"title": "文章内容", "title": "文章内容",
"description": "文章内容", "description": "文章内容",
"label": "文章内容" "label": "文章内容"
}, },
"excerpt": { "excerpt": {
"bsonType": "string", "bsonType": "string",
"title": "文章摘录", "title": "文章摘录",
"description": "文章摘录", "description": "文章摘录",
"label": "摘要" "label": "摘要"
}, },
"article_status": { "article_status": {
"bsonType": "int", "bsonType": "int",
"title": "文章状态", "title": "文章状态",
"minimum": 0, "description": "文章状态0 草稿箱 1 已发布",
"maximum": 1, "enum": [
"description": "文章状态0 草稿箱 1 已发布" {
"value": 0,
"text": "草稿箱"
},
{
"value": 1,
"text": "已发布"
}
]
}, },
"view_count": { "view_count": {
"bsonType": "int", "bsonType": "int",
"title": "阅读数量", "title": "阅读数量",
"description": "阅读数量", "description": "阅读数量",
"permission": { "permission": {
"write": false "write": false
@ -72,7 +80,7 @@
}, },
"is_sticky": { "is_sticky": {
"bsonType": "bool", "bsonType": "bool",
"title": "是否置顶", "title": "是否置顶",
"description": "是否置顶", "description": "是否置顶",
"permission": { "permission": {
"write": false "write": false
@ -80,7 +88,7 @@
}, },
"is_essence": { "is_essence": {
"bsonType": "bool", "bsonType": "bool",
"title": "阅读加精", "title": "阅读加精",
"description": "阅读加精", "description": "阅读加精",
"permission": { "permission": {
"write": false "write": false
@ -88,7 +96,7 @@
}, },
"comment_status": { "comment_status": {
"bsonType": "int", "bsonType": "int",
"title": "开放评论", "title": "开放评论",
"minimum": 0, "minimum": 0,
"maximum": 1, "maximum": 1,
"description": "评论状态0 关闭 1 开放" "description": "评论状态0 关闭 1 开放"
@ -103,17 +111,17 @@
"last_comment_user_id": { "last_comment_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"
}, },
"avatar": { "avatar": {
"bsonType": "string", "bsonType": "string",
"title": "封面大图", "title": "封面大图",
"description": "缩略图地址", "description": "缩略图地址",
"label": "封面大图" "label": "封面大图"
}, },
"publish_date": { "publish_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"title": "发表时间", "title": "发表时间",
"description": "发表时间", "description": "发表时间",
"defaultValue": { "defaultValue": {
"$env": "now" "$env": "now"
@ -121,7 +129,7 @@
}, },
"publish_ip": { "publish_ip": {
"bsonType": "string", "bsonType": "string",
"title": "发布文章时IP地址", "title": "发布文章时IP地址",
"description": "发表时 IP 地址", "description": "发表时 IP 地址",
"forceDefaultValue": { "forceDefaultValue": {
"$env": "clientIP" "$env": "clientIP"
@ -129,22 +137,22 @@
}, },
"last_modify_date": { "last_modify_date": {
"bsonType": "timestamp", "bsonType": "timestamp",
"title": "最后修改时间", "title": "最后修改时间",
"description": "最后修改时间", "description": "最后修改时间",
"defaultValue": { "defaultValue": {
"$env": "now" "$env": "now"
} }
}, },
"last_modify_ip": { "last_modify_ip": {
"bsonType": "string", "bsonType": "string",
"description": "最后修改时 IP 地址", "description": "最后修改时 IP 地址",
"forceDefaultValue": { "forceDefaultValue": {
"$env": "clientIP" "$env": "clientIP"
} }
}, },
"mode": { "mode": {
"bsonType": "number", "bsonType": "number",
"title": "排版显示模式", "title": "排版显示模式",
"description": "排版显示模式,如左图右文、上图下文等" "description": "排版显示模式,如左图右文、上图下文等"
} }
} }