opendb-news-articles-detail.schema.json 2.7 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
{
	"bsonType": "object",
	"permission": {
		"create": "auth.uid != null",
		"delete": "doc.user_id == auth.uid",
		"read": true,
		"update": "doc.user_id == auth.uid"
	},
	"properties": {
		"_id": {
			"description": "存储文档 ID(用户 ID),系统自动生成"
		},
		"article_status": {
			"bsonType": "int",
			"description": "文章状态:0 草稿箱 1 已发布",
			"maximum": 1,
			"minimum": 0
		},
		"avatar": {
			"bsonType": "string",
			"description": "缩略图地址",
			"label": "封面大图"
		},
		"category_id": {
			"bsonType": "string",
			"description": "分类 id,参考`uni-news-categories`表"
		},
		"comment_count": {
			"bsonType": "int",
			"description": "评论数量",
			"permission": {
				"write": false
			}
		},
		"comment_status": {
			"bsonType": "int",
			"description": "评论状态:0 关闭  1 开放",
			"maximum": 1,
			"minimum": 0
		},
		"content": {
			"bsonType": "string",
			"description": "文章内容",
			"label": "文章内容"
		},
		"excerpt": {
			"bsonType": "string",
			"description": "文章摘录",
			"label": "摘要"
		},
		"is_essence": {
			"bsonType": "bool",
			"description": "阅读加精",
			"permission": {
				"write": false
			}
		},
		"is_sticky": {
			"bsonType": "bool",
			"description": "是否置顶",
			"permission": {
				"write": false
			}
		},
		"last_comment_user_id": {
			"bsonType": "string",
			"description": "最后回复用户 id,参考`uni-id-users` 表"
		},
		"last_modify_date": {
			"bsonType": "timestamp",
			"description": "最后修改时间"
		},
		"last_modify_ip": {
			"bsonType": "string",
			"description": "最后修改时 IP 地址"
		},
		"like_count": {
			"bsonType": "int",
			"description": "喜欢数、点赞数",
			"permission": {
				"write": false
			}
		},
		"mode": {
			"bsonType": "number",
			"description": "排版显示模式"
		},
		"publish_date": {
			"bsonType": "timestamp",
			"defaultValue": {
				"$env": "now"
			},
			"description": "发表时间"
		},
		"publish_ip": {
			"bsonType": "string",
			"description": "发表时 IP 地址",
			"forceDefaultValue": {
				"$env": "clientIP"
			}
		},
		"title": {
			"bsonType": "string",
			"description": "标题",
			"label": "标题"
		},
		"user_id": {
			"bsonType": "string",
			"description": "文章作者ID, 参考`uni-id-users` 表"
		},
		"view_count": {
			"bsonType": "int",
			"description": "阅读数量",
			"permission": {
				"write": false
			}
		}
	},
	"required": ["user_id", "title", "content", "article_status", "view_count", "like_count", "is_sticky", "is_essence",
		"comment_status", "comment_count", "mode"
	]
雪洛's avatar
雪洛 已提交
122
}