2020-07-31 18:34:27 +08:00
|
|
|
|
{
|
|
|
|
|
"schema": {
|
|
|
|
|
"bsonType": "object",
|
2020-12-04 18:50:58 +08:00
|
|
|
|
"required": ["user_id", "title", "content", "article_status", "view_count", "like_count", "is_sticky", "is_essence", "comment_status", "comment_count"],
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"permission": {
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"read": true,
|
|
|
|
|
"create": "auth.uid != null",
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"update": "doc.uid == auth.uid",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"delete": "doc.uid == auth.uid"
|
2020-10-27 14:45:23 +08:00
|
|
|
|
},
|
2020-07-31 18:34:27 +08:00
|
|
|
|
"properties": {
|
|
|
|
|
"_id": {
|
|
|
|
|
"description": "存储文档 ID(用户 ID),系统自动生成"
|
|
|
|
|
},
|
|
|
|
|
"user_id": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-10 16:11:13 +08:00
|
|
|
|
"description": "文章作者ID, 参考`uni-id-users` 表",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"foreignKey": "uni-id-users._id",
|
|
|
|
|
"defaultValue": {
|
|
|
|
|
"$env": "uid"
|
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"category_id": {
|
|
|
|
|
"bsonType": "string",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "分类",
|
2020-11-10 16:11:13 +08:00
|
|
|
|
"description": "分类 id,参考`uni-news-categories`表",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"foreignKey": "opendb-news-categories._id",
|
|
|
|
|
"enum": {
|
|
|
|
|
"collection": "opendb-news-categories",
|
|
|
|
|
"field": "name as text, _id as value"
|
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"title": {
|
|
|
|
|
"bsonType": "string",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "标题",
|
2020-10-26 15:33:27 +08:00
|
|
|
|
"description": "标题",
|
|
|
|
|
"label": "标题"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"content": {
|
|
|
|
|
"bsonType": "string",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "文章内容",
|
2020-10-26 15:33:27 +08:00
|
|
|
|
"description": "文章内容",
|
|
|
|
|
"label": "文章内容"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"excerpt": {
|
|
|
|
|
"bsonType": "string",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "文章摘录",
|
2020-10-26 15:33:27 +08:00
|
|
|
|
"description": "文章摘录",
|
|
|
|
|
"label": "摘要"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"article_status": {
|
|
|
|
|
"bsonType": "int",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "文章状态",
|
|
|
|
|
"description": "文章状态:0 草稿箱 1 已发布",
|
|
|
|
|
"enum": [
|
|
|
|
|
{
|
|
|
|
|
"value": 0,
|
|
|
|
|
"text": "草稿箱"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"value": 1,
|
|
|
|
|
"text": "已发布"
|
|
|
|
|
}
|
|
|
|
|
]
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"view_count": {
|
|
|
|
|
"bsonType": "int",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "阅读数量",
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"description": "阅读数量",
|
|
|
|
|
"permission": {
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"write": false
|
2020-10-27 14:45:23 +08:00
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"like_count": {
|
|
|
|
|
"bsonType": "int",
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"description": "喜欢数、点赞数",
|
|
|
|
|
"permission": {
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"write": false
|
2020-10-27 14:45:23 +08:00
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"is_sticky": {
|
|
|
|
|
"bsonType": "bool",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "是否置顶",
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"description": "是否置顶",
|
|
|
|
|
"permission": {
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"write": false
|
2020-10-27 14:45:23 +08:00
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"is_essence": {
|
|
|
|
|
"bsonType": "bool",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "阅读加精",
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"description": "阅读加精",
|
|
|
|
|
"permission": {
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"write": false
|
2020-10-27 14:45:23 +08:00
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"comment_status": {
|
|
|
|
|
"bsonType": "int",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "开放评论",
|
2020-12-15 10:46:06 +08:00
|
|
|
|
"description": "评论状态:0 关闭 1 开放",
|
|
|
|
|
"enum": [
|
|
|
|
|
{
|
|
|
|
|
"value": 0,
|
|
|
|
|
"text": "关闭"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"value": 1,
|
|
|
|
|
"text": "开放"
|
|
|
|
|
}
|
|
|
|
|
]
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"comment_count": {
|
|
|
|
|
"bsonType": "int",
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"description": "评论数量",
|
|
|
|
|
"permission": {
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"write": false
|
2020-10-27 14:45:23 +08:00
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"last_comment_user_id": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-10 16:11:13 +08:00
|
|
|
|
"description": "最后回复用户 id,参考`uni-id-users` 表",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"foreignKey": "uni-id-users._id"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"avatar": {
|
|
|
|
|
"bsonType": "string",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "封面大图",
|
2020-10-26 15:33:27 +08:00
|
|
|
|
"description": "缩略图地址",
|
|
|
|
|
"label": "封面大图"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"publish_date": {
|
|
|
|
|
"bsonType": "timestamp",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "发表时间",
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"description": "发表时间",
|
|
|
|
|
"defaultValue": {
|
|
|
|
|
"$env": "now"
|
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"publish_ip": {
|
|
|
|
|
"bsonType": "string",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "发布文章时IP地址",
|
2020-10-27 14:45:23 +08:00
|
|
|
|
"description": "发表时 IP 地址",
|
|
|
|
|
"forceDefaultValue": {
|
|
|
|
|
"$env": "clientIP"
|
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"last_modify_date": {
|
|
|
|
|
"bsonType": "timestamp",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "最后修改时间",
|
2020-12-04 18:50:58 +08:00
|
|
|
|
"description": "最后修改时间",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"defaultValue": {
|
|
|
|
|
"$env": "now"
|
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"last_modify_ip": {
|
|
|
|
|
"bsonType": "string",
|
2020-12-04 18:50:58 +08:00
|
|
|
|
"description": "最后修改时 IP 地址",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"forceDefaultValue": {
|
|
|
|
|
"$env": "clientIP"
|
|
|
|
|
}
|
2020-08-17 14:49:31 +08:00
|
|
|
|
},
|
|
|
|
|
"mode": {
|
|
|
|
|
"bsonType": "number",
|
2020-12-15 10:42:18 +08:00
|
|
|
|
"title": "排版显示模式",
|
2020-12-04 17:22:25 +08:00
|
|
|
|
"description": "排版显示模式,如左图右文、上图下文等"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"index": []
|
|
|
|
|
}
|