add collection,database: uni-id, uni-mall, uni-news

This commit is contained in:
handongxun 2020-07-31 18:34:27 +08:00 committed by handongxun
parent 41fed7a584
commit e36e0d980d
18 changed files with 599 additions and 0 deletions

View File

@ -0,0 +1,162 @@
{
"schema": {
"bsonType": "object",
"required": ["username", "password", "status"],
"properties": {
"_id": {
"description": "存储文档 ID用户 ID系统自动生成"
},
"username": {
"bsonType": "string",
"description": "用户名,不允许重复"
},
"password": {
"bsonType": "string",
"description": "密码,加密存储"
},
"nickname": {
"bsonType": "string",
"description": "用户昵称"
},
"gender": {
"bsonType": "int",
"minimum": 0,
"maximum": 2,
"description": "用户性别0 未知 1 男性 2 女性"
},
"status": {
"bsonType": "int",
"minimum": 0,
"maximum": 3,
"description": "用户状态0 正常 1 禁用 2 审核中 3 审核拒绝"
},
"mobile": {
"bsonType": "string",
"description": "手机号码"
},
"mobile_confirmed": {
"bsonType": "int",
"minimum": 0,
"maximum": 1,
"description": "手机号验证状态0 未验证 1 已验证"
},
"email": {
"bsonType": "string",
"description": "邮箱地址"
},
"email_confirmed": {
"bsonType": "int",
"minimum": 0,
"maximum": 1,
"description": "邮箱验证状态0 未验证 1 已验证"
},
"avatar": {
"bsonType": "string",
"description": "头像地址"
},
"wx_unionid": {
"bsonType": "string",
"description": "微信unionid"
},
"wx_openid": {
"bsonType": "object",
"description": "微信各个平台openid",
"properties": {
"app-plus": {
"bsonType": "string",
"description": "app平台微信openid"
},
"mp-weixin": {
"bsonType": "string",
"description": "微信小程序平台openid"
}
}
},
"ali_openid": {
"bsonType": "string",
"description": "支付宝平台openid"
},
"comment": {
"bsonType": "string",
"description": "备注"
},
"realname_auth": {
"bsonType": "object",
"description": "实名认证信息",
"required": ["type", "auth_status"],
"properties": {
"type": {
"bsonType": "int",
"minimum": 0,
"maximum": 1,
"description": "用户类型0 个人用户 1 企业用户"
},
"auth_status": {
"bsonType": "int",
"minimum": 0,
"maximum": 3,
"description": "认证状态0 未认证 1 等待认证 2 认证通过 3 认证失败"
},
"auth_date": {
"bsonType": "timestamp",
"description": "认证通过时间"
},
"real_name": {
"bsonType": "string",
"description": "真实姓名/企业名称"
},
"identity": {
"bsonType": "string",
"description": "身份证号码/营业执照号码"
},
"id_card_front": {
"bsonType": "string",
"description": "身份证正面照 URL"
},
"id_card_back": {
"bsonType": "string",
"description": "身份证反面照 URL"
},
"in_hand": {
"bsonType": "string",
"description": "手持身份证照片 URL"
},
"license": {
"bsonType": "string",
"description": "营业执照 URL"
},
"contact_person": {
"bsonType": "string",
"description": "联系人姓名"
},
"contact_mobile": {
"bsonType": "string",
"description": "联系人手机号码"
},
"contact_email": {
"bsonType": "string",
"description": "联系人邮箱"
}
}
},
"register_date": {
"bsonType": "timestamp",
"description": "注册时间"
},
"register_ip": {
"bsonType": "string",
"description": "注册时 IP 地址"
},
"last_login_date": {
"bsonType": "timestamp",
"description": "最后登录时间"
},
"last_login_ip": {
"bsonType": "string",
"description": "最后登录时 IP 地址"
}
}
},
"data": [],
"index": []
}

View File

@ -0,0 +1,9 @@
{
"name": "@opendb/uni-id-users",
"version": "0.0.1",
"description": "uni-id-users",
"keywords": ["uni-id", "用户管理", "登录", "注册"],
"opendb": {
"type": "collection"
}
}

View File

@ -0,0 +1,25 @@
{
"schema": {
"bsonType": "object",
"required": ["name", "description", "create_date"],
"properties": {
"_id": {
"description": "存储文档 ID文章 ID系统自动生成"
},
"name": {
"bsonType": "string",
"description": "类别名称"
},
"description": {
"bsonType": "string",
"description": "类别描述"
},
"create_date": {
"bsonType": "timestamp",
"description": "创建时间"
}
}
},
"data": [],
"index": []
}

View File

@ -0,0 +1,9 @@
{
"name": "@opendb/uni-mall-categories",
"version": "0.0.1",
"description": "uni-mall-categories",
"keywords": ["电商系统", "商品类别"],
"opendb": {
"type": "collection"
}
}

View File

@ -0,0 +1,33 @@
{
"schema": {
"bsonType": "object",
"required": ["goods_id", "user_id", "comment_content"],
"properties": {
"_id": {
"description": "存储文档 ID文章 ID系统自动生成"
},
"goods_id": {
"bsonType": "string",
"description": "分类 id参考`uni-mall-categories`表"
},
"user_id": {
"bsonType": "string",
"description": "商品的唯一货号"
},
"comment_content": {
"bsonType": "string",
"description": "评论内容"
},
"comment_date": {
"bsonType": "timestamp",
"description": "评论发表时间"
},
"comment_ip": {
"bsonType": "string",
"description": "评论发表时 IP 地址"
}
}
},
"data": [],
"index": []
}

View File

@ -0,0 +1,9 @@
{
"name": "@opendb/uni-mall-comments",
"version": "0.0.1",
"description": "uni-mall-comments",
"keywords": ["电商系统", "商品评论表"],
"opendb": {
"type": "collection"
}
}

View File

@ -0,0 +1,93 @@
{
"schema": {
"bsonType": "object",
"required": ["goods_sn", "name", "remain_count", "month_sell_count", "total_sell_count", "comment_count", "is_real", "is_on_sale", "is_alone_sale", "is_best", "is_new", "is_hot"],
"properties": {
"_id": {
"description": "存储文档 ID文章 ID系统自动生成"
},
"category_id": {
"bsonType": "string",
"description": "分类 id参考`uni-mall-categories`表"
},
"goods_sn": {
"bsonType": "string",
"description": "商品的唯一货号"
},
"name": {
"bsonType": "string",
"description": "商品名称"
},
"keywords": {
"bsonType": "string",
"description": "商品关键字,为搜索引擎收录使用"
},
"goods_desc": {
"bsonType": "string",
"description": "商品详细描述"
},
"goods_thumb": {
"bsonType": "string",
"description": "商品缩略图,用于在列表或搜索结果中预览显示"
},
"goods_banner_imgs": {
"bsonType": "array",
"description": "商品详情页的banner图地址"
},
"remain_count": {
"bsonType": "int",
"description": "库存数量"
},
"month_sell_count": {
"bsonType": "int",
"description": "月销量"
},
"total_sell_count": {
"bsonType": "int",
"description": "总销量"
},
"comment_count": {
"bsonType": "int",
"description": "累计评论数"
},
"is_real": {
"bsonType": "bool",
"description": "是否实物"
},
"is_on_sale": {
"bsonType": "bool",
"description": "是否上架销售"
},
"is_alone_sale": {
"bsonType": "bool",
"description": "是否能单独销售;如果不能单独销售,则只能作为某商品的配件或者赠品销售"
},
"is_best": {
"bsonType": "bool",
"description": "是否精品"
},
"is_new": {
"bsonType": "bool",
"description": "是否新品"
},
"is_hot": {
"bsonType": "bool",
"description": "是否热销"
},
"add_date": {
"bsonType": "timestamp",
"description": "上架时间"
},
"last_modify_date": {
"bsonType": "timestamp",
"description": "最后修改时间"
},
"seller_note": {
"bsonType": "string",
"description": "商家备注,仅商家可见"
}
}
},
"data": [],
"index": []
}

View File

@ -0,0 +1,9 @@
{
"name": "@opendb/uni-mall-goods",
"version": "0.0.1",
"description": "uni-mall-goods",
"keywords": ["电商系统", "商品表"],
"opendb": {
"type": "collection"
}
}

View File

@ -0,0 +1,89 @@
{
"schema": {
"bsonType": "object",
"required": ["user_id", "title", "content", "article_status", "view_count", "like_count", "is_sticky", "is_essence", "comment_status", "comment_count"],
"properties": {
"_id": {
"description": "存储文档 ID用户 ID系统自动生成"
},
"user_id": {
"bsonType": "string",
"description": "文章作者ID 参考`uni-id-users` 表"
},
"category_id": {
"bsonType": "string",
"description": "分类 id参考`uni-news-categories`表"
},
"title": {
"bsonType": "string",
"description": "标题"
},
"content": {
"bsonType": "string",
"description": "文章内容"
},
"excerpt": {
"bsonType": "string",
"description": "文章摘录"
},
"article_status": {
"bsonType": "int",
"minimum": 0,
"maximum": 1,
"description": "文章状态0 草稿箱 1 已发布"
},
"view_count": {
"bsonType": "int",
"description": "阅读数量"
},
"like_count": {
"bsonType": "int",
"description": "喜欢数、点赞数"
},
"is_sticky": {
"bsonType": "bool",
"description": "是否置顶"
},
"is_essence": {
"bsonType": "bool",
"description": "阅读加精"
},
"comment_status": {
"bsonType": "int",
"minimum": 0,
"maximum": 1,
"description": "评论状态0 关闭 1 开放"
},
"comment_count": {
"bsonType": "int",
"description": "评论数量"
},
"last_comment_user_id": {
"bsonType": "string",
"description": "最后回复用户 id参考`uni-id-users` 表"
},
"avatar": {
"bsonType": "string",
"description": "缩略图地址"
},
"publish_date": {
"bsonType": "timestamp",
"description": "发表时间"
},
"publish_ip": {
"bsonType": "string",
"description": "发表时 IP 地址"
},
"last_modify_date": {
"bsonType": "timestamp",
"description": "最后修改时间"
},
"last_modify_ip": {
"bsonType": "string",
"description": "最后修改时 IP 地址"
}
}
},
"data": [],
"index": []
}

View File

@ -0,0 +1,9 @@
{
"name": "@opendb/uni-news-articles",
"version": "0.0.1",
"description": "uni-news-articles",
"keywords": ["文章&评论", "文章表"],
"opendb": {
"type": "collection"
}
}

View File

@ -0,0 +1,37 @@
{
"schema": {
"bsonType": "object",
"required": ["name", "description", "icon"],
"properties": {
"_id": {
"description": "存储文档 ID文章 ID系统自动生成"
},
"name": {
"bsonType": "string",
"description": "类别名称"
},
"description": {
"bsonType": "string",
"description": "类别描述"
},
"icon": {
"bsonType": "string",
"description": "类别图标地址"
},
"sort": {
"bsonType": "int",
"description": "类别显示顺序"
},
"article_count": {
"bsonType": "int",
"description": "该类别下文章数量"
},
"create_date": {
"bsonType": "timestamp",
"description": "创建时间"
}
}
},
"data": [],
"index": []
}

View File

@ -0,0 +1,9 @@
{
"name": "@opendb/uni-news-categories",
"version": "0.0.1",
"description": "uni-news-categories",
"keywords": ["文章&评论", "文章类别"],
"opendb": {
"type": "collection"
}
}

View File

@ -0,0 +1,49 @@
{
"schema": {
"bsonType": "object",
"required": ["article_id", "user_id", "comment_content", "like_count", "comment_type", "reply_user_id", "reply_comment_id"],
"properties": {
"_id": {
"description": "存储文档 ID文章 ID系统自动生成"
},
"article_id": {
"bsonType": "string",
"description": "文章IDuni-news-posts 表中的`_id`字段"
},
"user_id": {
"bsonType": "string",
"description": "评论者ID参考`uni-id-users` 表"
},
"comment_content": {
"bsonType": "string",
"description": "评论内容"
},
"like_count": {
"bsonType": "int",
"description": "评论喜欢数、点赞数"
},
"comment_type": {
"bsonType": "int",
"description": "回复类型: 0 针对文章的回复 1 针对评论的回复"
},
"reply_user_id": {
"bsonType": "string",
"description": "被回复的评论用户IDcomment_type为1时有效"
},
"reply_comment_id": {
"bsonType": "string",
"description": "被回复的评论IDcomment_type为1时有效"
},
"comment_date": {
"bsonType": "timestamp",
"description": "评论发表时间"
},
"comment_ip": {
"bsonType": "string",
"description": "评论发表时 IP 地址"
}
}
},
"data": [],
"index": []
}

View File

@ -0,0 +1,9 @@
{
"name": "@opendb/uni-news-comments",
"version": "0.0.1",
"description": "uni-news-comments",
"keywords": ["文章&评论", "文章评论表"],
"opendb": {
"type": "collection"
}
}

View File

@ -0,0 +1,10 @@
{
"uni-mall-categories": {
"data": [],
"index": []
},
"uni-mall-comments": {
"data": [],
"index": []
}
}

View File

@ -0,0 +1,15 @@
{
"name": "@opendb/uni-mall",
"version": "0.0.1",
"description": "电商系统",
"keywords": ["电商系统"],
"opendb": {
"type": "database"
},
"dependencies": {
"@opendb/uni-id-users": "^0.0.1",
"@opendb/uni-mall-goods": "^0.0.1",
"@opendb/uni-mall-categories": "^0.0.1",
"@opendb/uni-mall-comments": "^0.0.1"
}
}

View File

@ -0,0 +1,10 @@
{
"uni-news-categories": {
"data": [],
"index": []
},
"uni-news-comments": {
"data": [],
"index": []
}
}

View File

@ -0,0 +1,13 @@
{
"name": "@opendb/uni-news",
"version": "0.0.1",
"description": "新闻",
"keywords": ["新闻"],
"opendb": {
"type": "database"
},
"dependencies": {
"@opendb/uni-news-categories": "^0.0.1",
"@opendb/uni-news-comments": "^0.0.1"
}
}