diff --git a/collection/uni-id-users/collection.json b/collection/uni-id-users/collection.json new file mode 100644 index 0000000..ac99d76 --- /dev/null +++ b/collection/uni-id-users/collection.json @@ -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": [] +} diff --git a/collection/uni-id-users/package.json b/collection/uni-id-users/package.json new file mode 100644 index 0000000..83192e6 --- /dev/null +++ b/collection/uni-id-users/package.json @@ -0,0 +1,9 @@ +{ + "name": "@opendb/uni-id-users", + "version": "0.0.1", + "description": "uni-id-users", + "keywords": ["uni-id", "用户管理", "登录", "注册"], + "opendb": { + "type": "collection" + } +} diff --git a/collection/uni-mall-categories/collection.json b/collection/uni-mall-categories/collection.json new file mode 100644 index 0000000..9077392 --- /dev/null +++ b/collection/uni-mall-categories/collection.json @@ -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": [] +} diff --git a/collection/uni-mall-categories/package.json b/collection/uni-mall-categories/package.json new file mode 100644 index 0000000..8fe919a --- /dev/null +++ b/collection/uni-mall-categories/package.json @@ -0,0 +1,9 @@ +{ + "name": "@opendb/uni-mall-categories", + "version": "0.0.1", + "description": "uni-mall-categories", + "keywords": ["电商系统", "商品类别"], + "opendb": { + "type": "collection" + } +} diff --git a/collection/uni-mall-comments/collection.json b/collection/uni-mall-comments/collection.json new file mode 100644 index 0000000..0db460c --- /dev/null +++ b/collection/uni-mall-comments/collection.json @@ -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": [] +} diff --git a/collection/uni-mall-comments/package.json b/collection/uni-mall-comments/package.json new file mode 100644 index 0000000..789a72c --- /dev/null +++ b/collection/uni-mall-comments/package.json @@ -0,0 +1,9 @@ +{ + "name": "@opendb/uni-mall-comments", + "version": "0.0.1", + "description": "uni-mall-comments", + "keywords": ["电商系统", "商品评论表"], + "opendb": { + "type": "collection" + } +} diff --git a/collection/uni-mall-goods/collection.json b/collection/uni-mall-goods/collection.json new file mode 100644 index 0000000..889baf9 --- /dev/null +++ b/collection/uni-mall-goods/collection.json @@ -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": [] +} diff --git a/collection/uni-mall-goods/package.json b/collection/uni-mall-goods/package.json new file mode 100644 index 0000000..62051da --- /dev/null +++ b/collection/uni-mall-goods/package.json @@ -0,0 +1,9 @@ +{ + "name": "@opendb/uni-mall-goods", + "version": "0.0.1", + "description": "uni-mall-goods", + "keywords": ["电商系统", "商品表"], + "opendb": { + "type": "collection" + } +} diff --git a/collection/uni-news-articles/collection.json b/collection/uni-news-articles/collection.json new file mode 100644 index 0000000..e7109d3 --- /dev/null +++ b/collection/uni-news-articles/collection.json @@ -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": [] +} diff --git a/collection/uni-news-articles/package.json b/collection/uni-news-articles/package.json new file mode 100644 index 0000000..4a2bb62 --- /dev/null +++ b/collection/uni-news-articles/package.json @@ -0,0 +1,9 @@ +{ + "name": "@opendb/uni-news-articles", + "version": "0.0.1", + "description": "uni-news-articles", + "keywords": ["文章&评论", "文章表"], + "opendb": { + "type": "collection" + } +} diff --git a/collection/uni-news-categories/collection.json b/collection/uni-news-categories/collection.json new file mode 100644 index 0000000..0c4481d --- /dev/null +++ b/collection/uni-news-categories/collection.json @@ -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": [] +} diff --git a/collection/uni-news-categories/package.json b/collection/uni-news-categories/package.json new file mode 100644 index 0000000..0e0352c --- /dev/null +++ b/collection/uni-news-categories/package.json @@ -0,0 +1,9 @@ +{ + "name": "@opendb/uni-news-categories", + "version": "0.0.1", + "description": "uni-news-categories", + "keywords": ["文章&评论", "文章类别"], + "opendb": { + "type": "collection" + } +} diff --git a/collection/uni-news-comments/collection.json b/collection/uni-news-comments/collection.json new file mode 100644 index 0000000..fa29228 --- /dev/null +++ b/collection/uni-news-comments/collection.json @@ -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": "文章ID,uni-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": "被回复的评论用户ID,comment_type为1时有效" + }, + "reply_comment_id": { + "bsonType": "string", + "description": "被回复的评论ID,comment_type为1时有效" + }, + "comment_date": { + "bsonType": "timestamp", + "description": "评论发表时间" + }, + "comment_ip": { + "bsonType": "string", + "description": "评论发表时 IP 地址" + } + } + }, + "data": [], + "index": [] +} diff --git a/collection/uni-news-comments/package.json b/collection/uni-news-comments/package.json new file mode 100644 index 0000000..1e8f578 --- /dev/null +++ b/collection/uni-news-comments/package.json @@ -0,0 +1,9 @@ +{ + "name": "@opendb/uni-news-comments", + "version": "0.0.1", + "description": "uni-news-comments", + "keywords": ["文章&评论", "文章评论表"], + "opendb": { + "type": "collection" + } +} diff --git a/database/uni-mall/db_init.json b/database/uni-mall/db_init.json new file mode 100644 index 0000000..33aa9d4 --- /dev/null +++ b/database/uni-mall/db_init.json @@ -0,0 +1,10 @@ +{ + "uni-mall-categories": { + "data": [], + "index": [] + }, + "uni-mall-comments": { + "data": [], + "index": [] + } +} diff --git a/database/uni-mall/package.json b/database/uni-mall/package.json new file mode 100644 index 0000000..0669459 --- /dev/null +++ b/database/uni-mall/package.json @@ -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" + } +} diff --git a/database/uni-news/db_init.json b/database/uni-news/db_init.json new file mode 100644 index 0000000..1264d4b --- /dev/null +++ b/database/uni-news/db_init.json @@ -0,0 +1,10 @@ +{ + "uni-news-categories": { + "data": [], + "index": [] + }, + "uni-news-comments": { + "data": [], + "index": [] + } +} diff --git a/database/uni-news/package.json b/database/uni-news/package.json new file mode 100644 index 0000000..1c0605d --- /dev/null +++ b/database/uni-news/package.json @@ -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" + } +}