From 8115ea782ffb211331c139de4c15cafad75b869b Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Thu, 14 Sep 2023 11:20:28 +0800 Subject: [PATCH] feat:(uniCloud): clientDB --- pages.json | 9 + .../unicloud-database/unicloud-database.uvue | 312 ++++++++++++++++++ pages/tabBar/API.uvue | 4 + uniCloud-aliyun/database/foreign.schema.json | 25 ++ uniCloud-aliyun/database/local.schema.json | 28 ++ uniCloud-aliyun/database/type.schema.json | 30 ++ 6 files changed, 408 insertions(+) create mode 100644 pages/API/unicloud-database/unicloud-database.uvue create mode 100644 uniCloud-aliyun/database/foreign.schema.json create mode 100644 uniCloud-aliyun/database/local.schema.json create mode 100644 uniCloud-aliyun/database/type.schema.json diff --git a/pages.json b/pages.json index 88a6fe54..6e3bf2f4 100644 --- a/pages.json +++ b/pages.json @@ -900,6 +900,15 @@ } } + ,{ + "path" : "pages/API/unicloud-database/unicloud-database", + "style" : + { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + } ], "globalStyle": { "pageOrientation": "portrait", diff --git a/pages/API/unicloud-database/unicloud-database.uvue b/pages/API/unicloud-database/unicloud-database.uvue new file mode 100644 index 00000000..50dafe68 --- /dev/null +++ b/pages/API/unicloud-database/unicloud-database.uvue @@ -0,0 +1,312 @@ + + + + \ No newline at end of file diff --git a/pages/tabBar/API.uvue b/pages/tabBar/API.uvue index dc16c6db..1c7956a6 100644 --- a/pages/tabBar/API.uvue +++ b/pages/tabBar/API.uvue @@ -390,6 +390,10 @@ name: '云存储', url: 'unicloud-file-api', }, + { + name: 'clientDB', + url: 'unicloud-database', + }, ] as Page[], }, /* { diff --git a/uniCloud-aliyun/database/foreign.schema.json b/uniCloud-aliyun/database/foreign.schema.json new file mode 100644 index 00000000..d9654950 --- /dev/null +++ b/uniCloud-aliyun/database/foreign.schema.json @@ -0,0 +1,25 @@ +// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": true, + "update": true, + "delete": true + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "id": { + "bsonType": "string" + }, + "name": { + "bsonType": "string" + }, + "tag": { + "bsonType": "string" + } + } +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/local.schema.json b/uniCloud-aliyun/database/local.schema.json new file mode 100644 index 00000000..28bd811a --- /dev/null +++ b/uniCloud-aliyun/database/local.schema.json @@ -0,0 +1,28 @@ +// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": true, + "update": true, + "delete": true + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "id": { + "bsonType": "string" + }, + "name": { + "bsonType": "string" + }, + "tag": { + "bsonType": "string" + }, + "foreign_id": { + "foreignKey": "foreign.id" + } + } +} \ No newline at end of file diff --git a/uniCloud-aliyun/database/type.schema.json b/uniCloud-aliyun/database/type.schema.json new file mode 100644 index 00000000..0fb1618d --- /dev/null +++ b/uniCloud-aliyun/database/type.schema.json @@ -0,0 +1,30 @@ +// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": true, + "update": true, + "delete": true + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + }, + "num": { + "bsonType": "int" + }, + "tag": { + "bsonType": "string", + "maxLength": 50, + "minLength": 0 + }, + "date": { + "bsonType": "date" + }, + "point": { + "bsonType": "object" + } + } +} -- GitLab