From 77f742ec6ab37719bc34d60a42f22739b0c34b64 Mon Sep 17 00:00:00 2001 From: 042003124 <352065803@qq.com> Date: Thu, 4 May 2023 23:07:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=AB=98=E6=A0=A1=E5=9C=88?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fe-college-commentPost/index.js | 78 +++++++++++++++++++ .../fe-college-commentPost/package.json | 7 ++ .../fe-college-likePost/index.js | 58 ++++++++++++++ .../fe-college-likePost/package.json | 7 ++ .../fe-college-makePost/index.js | 53 +++++++++++++ .../fe-college-makePost/package.json | 7 ++ .../fe-college-postDetail/index.js | 61 +++++++++++++++ .../fe-college-postDetail/package.json | 7 ++ .../fe-college-postList/index.js | 32 +++++--- .../cloudfunctions/fe-my-information/index.js | 4 +- .../fe-my-resetpassword/index.js | 8 +- .../mustgo-activity-status.schema.json | 2 +- .../database/mustgo-college-post.schema.json | 16 +++- .../database/mustgo-post-comment.schema.json | 1 + .../database/mustgo-post-like.schema.json | 1 + .../database/mustgo-post.schema.json | 15 ++++ .../database/mustgo-registration.schema.json | 2 +- .../database/mustgo-role.schema.json | 2 +- .../mustgo-running-record.schema.json | 2 +- .../mustgo-school-activity.schema.json | 2 +- .../database/mustgo-team-activity.schema.json | 2 +- .../database/mustgo-team.schema.json | 2 +- .../database/mustgo-user.schema.json | 56 +------------ 23 files changed, 346 insertions(+), 79 deletions(-) create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/index.js create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/package.json create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/index.js create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/package.json create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/index.js create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/package.json create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/index.js create mode 100644 alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/package.json create mode 100644 alpha/admin/uniCloud-aliyun/database/mustgo-post-comment.schema.json create mode 100644 alpha/admin/uniCloud-aliyun/database/mustgo-post-like.schema.json create mode 100644 alpha/admin/uniCloud-aliyun/database/mustgo-post.schema.json diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/index.js new file mode 100644 index 0000000..aec4495 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/index.js @@ -0,0 +1,78 @@ +'use strict'; +exports.main = async (event, context) => { + const db = uniCloud.database(); + const user_table = db.collection("mustgo-user") + const comment_table = db.collection("mustgo-post-comment") + const post_table = db.collection("mustgo-post") + + const res = await user_table.where({ + _id:event.userId + }).get() + + if(res.affectedDocs == 1){ + const res2 = await post_table.where({ + _id:event.postId + }).get() + + if(res2.affectedDocs == 1){ + const res3 = await post_table.doc(event.postId).update({ + comment_num:res2.data[0]["comment_num"] + 1 + }) + + var time = getSystemTime() + var like = 0 + const res4 = await comment_table.add({ + owner_id:event.userId, + date:time, + likes:like, + post_id:event.postId, + check_status:false, + content:event.content + }) + + return{ + code:200, + message:"评论帖子成功", + data:{ + postId:res2.data[0]["_id"], + newCommentNum:res2.data[0]["comment_num"] + 1, + commenterIcon:res.data[0]["icon"], + commenterName:res.data[0]["name"], + commentDatetime:time, + commentLikes:like + } + } + + } + } + + return { + code: 400, + message: "评论帖子失败", + data: {} + } + +}; + +function getSystemTime() { + // 实例化日期类 + var time = new Date(); + // 获取完整的年份(4位) + var year = time.getFullYear(); + // 获取月份(0-11,0代表1月) + var month = time.getMonth() + 1; + // 获取日期(1-31) + var date = time.getDate(); + // 获取小时 + var h = time.getHours(); + h = h < 10 ? '0' + h : h; + // 获取分钟 + var m = time.getMinutes(); + m = m < 10 ? '0' + m : m; + // 获取秒钟 + var s = time.getSeconds(); + s = s < 10 ? '0' + s : s; + // 合并返回 + return(year + "-" + month + "-" + date + " " + h + ":" + m + ":" + s) ; + +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/package.json b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/package.json new file mode 100644 index 0000000..6840c04 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-commentPost/package.json @@ -0,0 +1,7 @@ +{ + "name": "fe-college-commentPost", + "dependencies": {}, + "extensions": { + "uni-cloud-jql": {} + } +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/index.js new file mode 100644 index 0000000..332fc7a --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/index.js @@ -0,0 +1,58 @@ +'use strict'; +exports.main = async (event, context) => { + //event为客户端上传的参数 + const db = uniCloud.database(); + const post_table = db.collection("mustgo-post") + const like_table = db.collection("mustgo-post-like") + const res = await post_table.where({ + _id:event.postId + }).get() + + const islike = await like_table.where({ + post_id:event.postId, + user_id:event.userId + }).get() + if(islike.affectedDocs == 0 && res.affectedDocs == 1){ + const res2 = await post_table.doc(event.postId).update({ + likes:res.data[0]["likes"] + 1 + }) + + const res3 = await like_table.add({ + post_id:event.postId, + user_id:event.userId + }) + + return { + code: 200, + message: "点赞帖子成功", + data: { + postId:res.data[0]["_id"], + newlikes:res.data[0]["likes"] + 1 + } + } + } + else if(islike.affectedDocs == 1 && res.affectedDocs == 1){ + const res4 = await post_table.doc(event.postId).update({ + likes:res.data[0]["likes"] - 1, + }) + + like_table.doc(islike.data[0]["_id"]).remove().then((res5) => { + console.log("删除成功"); + }) + + return { + code: 200, + message: "取消点赞帖子成功", + data: { + postId:res.data[0]["_id"], + newlikes:res.data[0]["likes"] - 1 + } + } +} + + return { + code: 500, + message: "服务器错误", + data: {} + } +}; \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/package.json b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/package.json new file mode 100644 index 0000000..d32dd55 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-likePost/package.json @@ -0,0 +1,7 @@ +{ + "name": "fe-college-likePost", + "dependencies": {}, + "extensions": { + "uni-cloud-jql": {} + } +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/index.js new file mode 100644 index 0000000..4304c28 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/index.js @@ -0,0 +1,53 @@ +'use strict'; +exports.main = async (event, context) => { + const db = uniCloud.database(); + const post_table = db.collection("mustgo-post") + const res = await post_table.add({ + content:event.content, + date:getSystemTime(), + likes:0, + owner_id:event.userId, + check_status:false, + comment_num:0, + url:event.picture + }) + if(res.id.length > 0){ + return{ + code:200, + message:"发布帖子成功", + data:{ + postId:res.id + } + } + } + + return { + code: 400, + message: "发布帖子失败", + data: {} + } + +}; + +function getSystemTime() { + // 实例化日期类 + var time = new Date(); + // 获取完整的年份(4位) + var year = time.getFullYear(); + // 获取月份(0-11,0代表1月) + var month = time.getMonth() + 1; + // 获取日期(1-31) + var date = time.getDate(); + // 获取小时 + var h = time.getHours(); + h = h < 10 ? '0' + h : h; + // 获取分钟 + var m = time.getMinutes(); + m = m < 10 ? '0' + m : m; + // 获取秒钟 + var s = time.getSeconds(); + s = s < 10 ? '0' + s : s; + // 合并返回 + return(year + "-" + month + "-" + date + " " + h + ":" + m + ":" + s) ; + +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/package.json b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/package.json new file mode 100644 index 0000000..8dc017a --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-makePost/package.json @@ -0,0 +1,7 @@ +{ + "name": "fe-college-makePost", + "dependencies": {}, + "extensions": { + "uni-cloud-jql": {} + } +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/index.js new file mode 100644 index 0000000..7cc3732 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/index.js @@ -0,0 +1,61 @@ +'use strict'; +exports.main = async (event, context) => { + //event为客户端上传的参数 + const db = uniCloud.database(); + const post_table = db.collection("mustgo-post") + const comment_table = db.collection("mustgo-post-comment") + const user_table = db.collection("mustgo-user") + const res = await post_table.where({ + _id:event.postId + }).get() + const res3 = await comment_table.where({ + post_id:event.postId + }).get() + var arr = new Array + var list = new Array + arr =res3.data + if(res3.affectedDocs >= 0){ + for(var i = 0;i < arr.length;i++){ + const res4 = await user_table.where({ + _id:arr[i]["owner_id"] + }).get() + if(res4.affectedDocs == 1){ + var comment ={ + commenterIcon:res4.data[0]["icon"], + commenterName:res4.data[0]["name"], + commentContent:arr[i]["content"], + commentDatetime:arr[i]["date"], + commentLikes:arr[i]["likes"] + } + list.push(comment) + } + } + } + + if (res.affectedDocs == 1) { + const res2 = await user_table.where({ + _id:res.data[0]["owner_id"] + }).get() + if(res2.affectedDocs == 1){ + return { + code: 200, + message: "成功返回帖子详情", + data: { + ownerName:res2.data[0]["name"], + ownerIcon:res2.data[0]["icon"], + datetime:res.data[0]["date"], + content:res.data[0]["content"], + pictureList:res.data[0]["url"], + likes:res.data[0]["likes"], + comments:res.data[0]["comment_num"], + commentList:list + } + } + } + } + return { + code: 400, + message: "查看帖子详情失败", + data: {} + } +}; \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/package.json b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/package.json new file mode 100644 index 0000000..9076aa3 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postDetail/package.json @@ -0,0 +1,7 @@ +{ + "name": "fe-college-postDetail", + "dependencies": {}, + "extensions": { + "uni-cloud-jql": {} + } +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postList/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postList/index.js index 9c8109e..1fcf9a5 100644 --- a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postList/index.js +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-college-postList/index.js @@ -2,25 +2,35 @@ exports.main = async (event, context) => { //event为客户端上传的参数 const db = uniCloud.database(); - const collection = db.collection("opendb-news-articles") - const res = await collection.get(); - var postList = new Array + const post_table = db.collection("mustgo-post") + const user_table = db.collection("mustgo-user") + const res = await post_table.get(); + var list = new Array var arr = new Array; arr = res.data; if (res.affectedDocs >= 0) { for (var i = 0; i < arr.length; i++) { - var post = { - postId: arr[i]["_id"], - userIcon: arr[i]["title"], - picture: arr[i]["background_picture"] + const res2 = await user_table.where({ + _id:arr[i]["owner_id"] + }).get() + if(res2.affectedDocs == 1){ + var post = { + postId: arr[i]["_id"], + usericon:res2.data[0]["icon"], + username:res2.data[0]["name"], + content: arr[i]["content"], + likes:arr[i]["likes"], + comments:arr[i]["comment_num"], + pictureList:arr[i]["url"] + } + list.push(post); } - list.push(activity); } return { code: 200, - message: "成功返回活动列表", + message: "成功返回帖子列表", data: { - activityList: list + postList: list } } } @@ -29,4 +39,4 @@ exports.main = async (event, context) => { message: "服务器错误", data: {} } -}; +}; \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-information/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-information/index.js index f0cc408..9cb99c7 100644 --- a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-information/index.js +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-information/index.js @@ -6,7 +6,7 @@ exports.main = async (event, context) => { let res = await user_table.where({ _id: event.userId }).get() - var team = null + var team = "" if (res.affectedDocs == 1) { var team_id = res.data[0]["team_id"] if(team_id != null){ @@ -22,7 +22,7 @@ exports.main = async (event, context) => { code: 200, message: "成功返回用户信息", data: { - "res": res.data[0]["icon"], + "icon": res.data[0]["icon"], "username": res.data[0]["name"], "school": res.data[0]["school"], "team": team diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-resetpassword/index.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-resetpassword/index.js index f6dac70..4d33cab 100644 --- a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-resetpassword/index.js +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-my-resetpassword/index.js @@ -2,7 +2,7 @@ exports.main = async (event, context) => { const db = uniCloud.database() const user_table = db.collection('mustgo-user') - let res = await collection.where({ + let res = await user_table.where({ _id: event.userId, }).get() @@ -14,13 +14,15 @@ exports.main = async (event, context) => { return { "code": 200, "message": "重置密码成功成功", - "data": {} + "data": { + "userId":res.data[0]["_id"] + } } } } return { "code": 400, - "message": "重置密码失败", + "message": "原密码错误失败", "data": {} } }; \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-activity-status.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-activity-status.schema.json index e1e3915..ee1380e 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-activity-status.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-activity-status.schema.json @@ -1 +1 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"id":{"bsonType":"int","title":"活动状态id","description":"活动状态id"},"status":{"bsonType":"string","title":"活动状态","description":"活动状态"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-college-post.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-college-post.schema.json index e1e3915..07939fc 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-college-post.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-college-post.schema.json @@ -1 +1,15 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": false, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + } + } +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-post-comment.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-post-comment.schema.json new file mode 100644 index 0000000..e1e3915 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-post-comment.schema.json @@ -0,0 +1 @@ +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-post-like.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-post-like.schema.json new file mode 100644 index 0000000..e1e3915 --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-post-like.schema.json @@ -0,0 +1 @@ +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-post.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-post.schema.json new file mode 100644 index 0000000..07939fc --- /dev/null +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-post.schema.json @@ -0,0 +1,15 @@ +{ + "bsonType": "object", + "required": [], + "permission": { + "read": true, + "create": false, + "update": false, + "delete": false + }, + "properties": { + "_id": { + "description": "ID,系统自动生成" + } + } +} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-registration.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-registration.schema.json index e1e3915..cf350cd 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-registration.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-registration.schema.json @@ -1 +1 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"team_activity_id":{"bsonType":"string","foreignKey":"mustgo-team-activity._id","title":"小队活动id","description":"报名信息所属小队活动id"},"owner_id":{"bsonType":"string","foreignKey":"mustgo-user._id","title":"用户id","description":"报名者id"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-role.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-role.schema.json index e1e3915..ad51619 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-role.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-role.schema.json @@ -1 +1 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"identity":{"bsonType":"string","title":"身份","description":"用户身份"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-running-record.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-running-record.schema.json index e1e3915..d505ac6 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-running-record.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-running-record.schema.json @@ -1 +1 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"start_date":{"bsonType":"string","title":"开始时间","description":"运动开始时间"},"duration":{"bsonType":"int","title":"持续时间","description":"运动持续时间"},"feelings":{"bsonType":"string","title":"感受","description":"运动感受"},"owner_id":{"bsonType":"string","title":"用户id","description":"用户id","foreignKey":"mustgo-user._id"},"distance":{"bsonType":"double","title":"距离","description":"运动距离"},"pace":{"bsonType":"double","title":"配速","description":"运动配速"},"start_point":{"bsonType":"string","title":"起始地点","description":"运动起始地点"},"end_point":{"bsonType":"string","title":"结束地点","description":"运动结束地点"},"path_line":{"bsonType":"array","title":"路线","description":"运动路线"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-school-activity.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-school-activity.schema.json index e1e3915..4a61a2c 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-school-activity.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-school-activity.schema.json @@ -1 +1 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"title":{"bsonType":"string","title":"标题","description":"校园活动标题"},"content":{"bsonType":"string","title":"内容","description":"校园活动内容"},"start_date":{"bsonType":"string","title":"开始时间","description":"校园活动开始时间"},"end_date":{"bsonType":"string","title":"结束时间","description":"校园活动结束时间"},"owner_id":{"bsonType":"string","foreignKey":"mustgo-user._id","title":"发布者id","description":"校园活动发布者id"},"background_picture":{"bsonType":"string","title":"背景图片","description":"校园活动背景图片"},"place":{"bsonType":"string","title":"地点","description":"校园活动地点"},"status":{"bsonType":"int","foreignKey":"mustgo-activity-status.id","title":"活动状态","description":"校园活动状态"},"contact":{"bsonType":"string","title":"联系方式","description":"校园活动发布者联系方式"},"invitee":{"bsonType":"string","title":"面向对象","description":"校园活动面向对象"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-team-activity.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-team-activity.schema.json index e1e3915..f96adf8 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-team-activity.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-team-activity.schema.json @@ -1 +1 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"title":{"bsonType":"string","title":"标题","description":"小队活动标题"},"content":{"bsonType":"string","title":"内容","description":"小队活动内容"},"start_date":{"bsonType":"string","title":"开始时间","description":"小队活动开始时间"},"end_date":{"bsonType":"string","title":"结束时间","description":"小队活动结束时间"},"owner_id":{"bsonType":"string","foreignKey":"mustgo-user._id","title":"发布者id","description":"小队活动发布者id"},"background_picture":{"bsonType":"string","title":"背景图片","description":"小队活动背景图片"},"place":{"bsonType":"string","title":"地点","description":"小队活动地点"},"status":{"bsonType":"int","foreignKey":"mustgo-activity-status.id","title":"活动状态","description":"小队活动状态"},"participants":{"bsonType":"int","title":"参与人数","description":"小队活动参与人数"},"contact":{"bsonType":"string","title":"联系方式","description":"小队活动发布者联系方式"},"team_id":{"bsonType":"string","foreignKey":"mustgo-team._id","title":"小队id","description":"活动所属小队id"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-team.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-team.schema.json index e1e3915..76372d8 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-team.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-team.schema.json @@ -1 +1 @@ -{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"}}} \ No newline at end of file +{"bsonType":"object","required":[],"permission":{"read":false,"create":false,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"icon":{"bsonType":"string","title":"队标","description":"小队队标"},"name":{"bsonType":"string","title":"队名","description":"小队名称"},"owner_id":{"bsonType":"string","foreignKey":"mustgo-user._id","title":"发起人id","description":"小队发起人id"},"description":{"bsonType":"string","title":"描述","description":"小队描述"}}} \ No newline at end of file diff --git a/alpha/admin/uniCloud-aliyun/database/mustgo-user.schema.json b/alpha/admin/uniCloud-aliyun/database/mustgo-user.schema.json index 67b9949..f08f070 100644 --- a/alpha/admin/uniCloud-aliyun/database/mustgo-user.schema.json +++ b/alpha/admin/uniCloud-aliyun/database/mustgo-user.schema.json @@ -1,55 +1 @@ -<<<<<<< HEAD -{"bsonType":"object","required":[],"permission":{"read":false,"create":true,"update":false,"delete":false},"properties":{"_id":{"description":"ID,系统自动生成"},"name":{"bsonType":"string"},"icon":{"bsonType":"string"},"gender":{"bsonType":"string"},"password":{"bsonType":"string"},"phone_num":{"bsonType":"string"},"team_id":{"bsonType":"string","defaultValue":""},"school":{"bsonType":"string"},"type":{"bsonType":"string","foreignKey":"mustgo-role._id"},"total_running_distance":{"bsonType":"double","defaultValue":0},"total_walking_distance":{"bsonType":"double","defaultValue":0}}} -======= -{ - "bsonType": "object", - "required": [], - "permission": { - "read": false, - "create": true, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "name": { - "bsonType": "string" - }, - "icon": { - "bsonType": "string", - "description": "用户头像", - "defaultValue": "https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/0510a534-dd8d-41f0-8341-601aa677e243.jpg" - }, - "gender": { - "bsonType": "string" - }, - "password": { - "bsonType": "string" - }, - "phone_num": { - "bsonType": "string" - }, - "team_id": { - "bsonType": "string", - "defaultValue": "" - }, - "school": { - "bsonType": "string" - }, - "type": { - "bsonType": "string", - "foreignKey": "mustgo-role._id" - }, - "total_running_distance": { - "bsonType": "double", - "defaultValue": 0 - }, - "total_walking_distance": { - "bsonType": "double", - "defaultValue": 0 - } - } -} ->>>>>>> 9039ca03ce0a452fbd2b009e72becba2ca46c23b +{"bsonType":"object","required":[],"permission":{"read":false,"create":true,"update":false,"delete":false},"properties":{"_id":{"title":"id","description":"ID,系统自动生成"},"name":{"bsonType":"string","title":"姓名","description":"用户姓名"},"icon":{"bsonType":"string","title":"头像","description":"用户头像"},"gender":{"bsonType":"string","title":"性别","description":"用户性别"},"password":{"bsonType":"string","title":"密码","description":"用户密码"},"phone_num":{"bsonType":"string","title":"手机号码","description":"用户手机号码"},"team_id":{"bsonType":"string","defaultValue":"","title":"小队id","description":"用户所属小队id"},"school":{"bsonType":"string","title":"学校","description":"用户所属学校"},"type":{"bsonType":"string","foreignKey":"mustgo-role._id","title":"类型","description":"用户类型"},"total_running_distance":{"bsonType":"double","defaultValue":0,"title":"总跑步距离","description":"用户总跑步距离"},"total_walking_distance":{"bsonType":"double","defaultValue":0,"title":"总健走距离","description":"用户总健走距离"}}} \ No newline at end of file -- GitLab