diff --git a/collection/opendb-news-favorite/collection.json b/collection/opendb-news-favorite/collection.json new file mode 100644 index 0000000..ddce4fb --- /dev/null +++ b/collection/opendb-news-favorite/collection.json @@ -0,0 +1,20 @@ +{ + "schema": { + "bsonType": "object", + "required": ["user_id", "article_id"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "article_id": { + "bsonType": "string", + "description": "文章id,参考opendb-news-categories表" + }, + "user_id": { + "bsonType": "string", + "description": "收藏者id,参考uni-id-users表" + } + } + }, + "index": [] +} diff --git a/collection/opendb-news-favorite/package.json b/collection/opendb-news-favorite/package.json new file mode 100644 index 0000000..63c3bbb --- /dev/null +++ b/collection/opendb-news-favorite/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/opendb-news-favorite", + "version": "0.0.1", + "description": "opendb-news-favorite", + "keywords": ["收藏文章", "favorite"], + "opendb": { + "title": "收藏文章", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/collection/opendb-search-hot/collection.json b/collection/opendb-search-hot/collection.json new file mode 100644 index 0000000..8c06238 --- /dev/null +++ b/collection/opendb-search-hot/collection.json @@ -0,0 +1,24 @@ +{ + "schema": { + "bsonType": "object", + "required": ["content", "count"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "content": { + "bsonType": "string", + "description": "搜索内容" + }, + "count": { + "bsonType": "long", + "description": "搜索次数" + }, + "create_date": { + "bsonType": "timestamp", + "description": "统计时间" + } + } + }, + "index": [] +} diff --git a/collection/opendb-search-hot/package.json b/collection/opendb-search-hot/package.json new file mode 100644 index 0000000..1561e11 --- /dev/null +++ b/collection/opendb-search-hot/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/opendb-search-hot", + "version": "0.0.1", + "description": "opendb-search-hot", + "keywords": ["热搜"], + "opendb": { + "title": "热搜", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/collection/opendb-search-log/collection.json b/collection/opendb-search-log/collection.json new file mode 100644 index 0000000..e46deba --- /dev/null +++ b/collection/opendb-search-log/collection.json @@ -0,0 +1,28 @@ +{ + "schema": { + "bsonType": "object", + "required": ["user_id", "content"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "user_id": { + "bsonType": "string", + "description": "收藏者id,参考uni-id-users表" + }, + "device_id": { + "bsonType": "string", + "description": "设备id" + }, + "content": { + "bsonType": "string", + "description": "搜索内容" + }, + "create_date": { + "bsonType": "timestamp", + "description": "统计时间" + } + } + }, + "index": [] +} diff --git a/collection/opendb-search-log/package.json b/collection/opendb-search-log/package.json new file mode 100644 index 0000000..84a5aae --- /dev/null +++ b/collection/opendb-search-log/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/opendb-search-log", + "version": "0.0.1", + "description": "opendb-search-log", + "keywords": ["搜索记录"], + "opendb": { + "title": "搜索记录", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/collection/uni-id-followers/collection.json b/collection/uni-id-followers/collection.json new file mode 100644 index 0000000..6ca5b04 --- /dev/null +++ b/collection/uni-id-followers/collection.json @@ -0,0 +1,24 @@ +{ + "schema": { + "bsonType": "object", + "required": ["friend_uid", "follow_uid"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "friend_uid": { + "bsonType": "string", + "description": "被关注者user_id,参考uni-id-users表" + }, + "follow_uid": { + "bsonType": "string", + "description": "关注者user_id,参考uni-id-users表" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间" + } + } + }, + "index": [] +} diff --git a/collection/uni-id-followers/package.json b/collection/uni-id-followers/package.json new file mode 100644 index 0000000..1b60092 --- /dev/null +++ b/collection/uni-id-followers/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/uni-id-followers", + "version": "0.0.1", + "description": "uni-id-followers", + "keywords": ["关注用户", "followers"], + "opendb": { + "title": "关注用户", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/collection/uni-id-scores/collection.json b/collection/uni-id-scores/collection.json new file mode 100644 index 0000000..b2635ba --- /dev/null +++ b/collection/uni-id-scores/collection.json @@ -0,0 +1,37 @@ +{ + "schema": { + "bsonType": "object", + "required": ["user_id", "score", "balance"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "user_id": { + "bsonType": "string", + "description": "用户id,参考uni-id-users表" + }, + "score": { + "bsonType": "int", + "description": "本次变化的积分" + }, + "type": { + "bsonType": "int", + "enum": [1, 2], + "description": "积分类型 1:收入 2:指出" + }, + "balance": { + "bsonType": "int", + "description": "变化后的积分余额" + }, + "comment": { + "bsonType": "string", + "description": "备注,说明积分新增、消费的缘由" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间" + } + } + }, + "index": [] +} diff --git a/collection/uni-id-scores/package.json b/collection/uni-id-scores/package.json new file mode 100644 index 0000000..80b0449 --- /dev/null +++ b/collection/uni-id-scores/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/uni-id-scores", + "version": "0.0.1", + "description": "uni-id-scores", + "keywords": ["积分", "用户积分", "scores"], + "opendb": { + "title": "用户积分", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/collection/uni-id-task-log/collection.json b/collection/uni-id-task-log/collection.json new file mode 100644 index 0000000..efb74ca --- /dev/null +++ b/collection/uni-id-task-log/collection.json @@ -0,0 +1,32 @@ +{ + "schema": { + "bsonType": "object", + "required": ["user_id", "task_id"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "user_id": { + "bsonType": "string", + "description": "用户id,参考uni-id-users表" + }, + "task_id": { + "bsonType": "string", + "description": "任务ID" + }, + "result": { + "bsonType": "bool", + "description": "任务执行结果,true:成功,false:失败" + }, + "bounty": { + "bsonType": "int", + "description": "奖励积分" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间" + } + } + }, + "index": [] +} diff --git a/collection/uni-id-task-log/package.json b/collection/uni-id-task-log/package.json new file mode 100644 index 0000000..0745e3c --- /dev/null +++ b/collection/uni-id-task-log/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/uni-id-task-log", + "version": "0.0.1", + "description": "uni-id-task-log", + "keywords": ["任务日志", "task-log"], + "opendb": { + "title": "任务日志", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/collection/uni-id-task/collection.json b/collection/uni-id-task/collection.json new file mode 100644 index 0000000..22b378c --- /dev/null +++ b/collection/uni-id-task/collection.json @@ -0,0 +1,40 @@ +{ + "schema": { + "bsonType": "object", + "required": ["name", "comment"], + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "name": { + "bsonType": "string", + "description": "任务名称" + }, + "comment": { + "bsonType": "string", + "description": "任务描述" + }, + "bounty": { + "bsonType": "int", + "description": "任务完成后的奖励积分" + }, + "max_per_hour": { + "bsonType": "int", + "description": "每小时允许执行的最大次数" + }, + "max_per_day": { + "bsonType": "int", + "description": "每天允许执行的最大次数" + }, + "max_per_week": { + "bsonType": "int", + "description": "每周允许执行的最大次数" + }, + "create_date": { + "bsonType": "timestamp", + "description": "创建时间" + } + } + }, + "index": [] +} diff --git a/collection/uni-id-task/package.json b/collection/uni-id-task/package.json new file mode 100644 index 0000000..ac2bbcc --- /dev/null +++ b/collection/uni-id-task/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/uni-id-task", + "version": "0.0.1", + "description": "uni-id-task", + "keywords": ["任务", "task"], + "opendb": { + "title": "用户任务", + "type": "collection", + "contributors": [ + { + "name": "DCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/database/opendb-news/db_init.json b/database/opendb-news/db_init.json index d280a4d..754f1ed 100644 --- a/database/opendb-news/db_init.json +++ b/database/opendb-news/db_init.json @@ -1,5 +1,6 @@ { "opendb-news-articles": {}, "opendb-news-categories": {}, - "opendb-news-comments": {} + "opendb-news-comments": {}, + "opendb-news-favorite": {} } diff --git a/database/uni-id/db_init.json b/database/uni-id/db_init.json index faa1972..31b71b3 100644 --- a/database/uni-id/db_init.json +++ b/database/uni-id/db_init.json @@ -3,5 +3,9 @@ "uni-id-address": {}, "uni-id-device": {}, "uni-id-log": {}, - "uni-id-base-order":{} + "uni-id-base-order":{}, + "uni-id-scores": {}, + "uni-id-task": {}, + "uni-id-task-log": {}, + "uni-id-followers": {} } diff --git a/uni-id-score.md b/uni-id-score.md new file mode 100644 index 0000000..553ec00 --- /dev/null +++ b/uni-id-score.md @@ -0,0 +1,41 @@ + +## 用户积分表 + +表名:uni-id-scores + +| 字段 | 类型 | 必填 | 描述 | +| ---------------- | --------- | ---- | ------------------------------------------- | +| \_id | Object ID | 是 | 存储文档 ID,系统自动生成 | +| user_id | String | 是 | | +| score | Integer | 是 | 本次变化的积分 | +| type | Integer | 否 | 积分类型 1:收入 2:指出 | +| balance | Integer | 是 | 变化后的积分余额 | +| comment | String | 否 | 备注,说明积分新增、消费的缘由 | +| create_date | Timestamp | 否 | 创建时间 | + + +## 用户任务表 + +表名:uni-id-task + +| 字段 | 类型 | 必填 | 描述 | +| ---------------- | --------- | ---- | ------------------------------------------- | +| \_id | Object ID | 是 | 存储文档 ID,系统自动生成 | +| name | String | 是 | 任务名称 | +| comment | String | 是 | 任务描述 | +| bounty | Integer | 否 | 任务完成后的奖励积分 | +| max_per_hour | Integer | 否 | 每小时允许执行的最大次数 | +| max_per_day | Integer | 否 | 每天允许执行的最大次数 | +| max_per_week | Integer | 否 | 每周允许执行的最大次数 | +| create_date | Timestamp | 否 | 创建时间 | + +表名:uni-id-task-log + +| 字段 | 类型 | 必填 | 描述 | +| ---------------- | --------- | ---- | ------------------------------------------- | +| \_id | Object ID | 是 | 存储文档 ID,系统自动生成 | +| user_id | String | 是 | 用户ID | +| task_id | String | 是 | 任务ID | +| result | Boolean | 否 | 任务执行结果,true:成功,false:失败 | +| bounty | Integer | 否 | 奖励积分 | +| create_date | Timestamp | 否 | 创建时间 |