提交 4d63b86f 编写于 作者: M MicroMilo

运动模块接口实现

上级 948ff4ad
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"h5" : "h5" :
{ {
"launchtype" : "remote" "launchtype" : "local"
}, },
"type" : "uniCloud" "type" : "uniCloud"
} }
......
...@@ -46,15 +46,6 @@ ...@@ -46,15 +46,6 @@
<script> <script>
import tableData from './tableData.js' import tableData from './tableData.js'
// uniCloud.callFunction({
// name: 'auth',
// data: {
// phone: '15860855025',
// password: '123456'
// }
// })
// .then(res => {console.log(res);});
export default { export default {
data() { data() {
return { return {
......
<template> <template>
<view> <view>
<view class="uni-header"> <view class="uni-header">
<view class="uni-group"> <view class="uni-group">
<view class="uni-title"></view> <view class="uni-title"></view>
<view class="uni-sub-title"></view> <view class="uni-sub-title"></view>
</view> </view>
<view class="uni-group"> <view class="uni-group">
<input class="uni-search" type="text" v-model="query" @confirm="search" placeholder="请输入搜索内容" /> <input class="uni-search" type="text" v-model="query" @confirm="search" placeholder="请输入搜索内容" />
<button class="uni-button" type="default" size="mini" @click="search">搜索</button> <button class="uni-button" type="default" size="mini" @click="search">搜索</button>
<button class="uni-button" type="default" size="mini" @click="navigateTo('./add')">新增</button> <button class="uni-button" type="default" size="mini" @click="navigateTo('./add')">新增</button>
<button class="uni-button" type="default" size="mini" :disabled="!selectedIndexs.length" @click="delTable">批量删除</button> <button class="uni-button" type="default" size="mini" :disabled="!selectedIndexs.length"
<download-excel class="hide-on-phone" :fields="exportExcel.fields" :data="exportExcelData" :type="exportExcel.type" :name="exportExcel.filename"> @click="delTable">批量删除</button>
<button class="uni-button" type="primary" size="mini">导出 Excel</button> <download-excel class="hide-on-phone" :fields="exportExcel.fields" :data="exportExcelData"
</download-excel> :type="exportExcel.type" :name="exportExcel.filename">
</view> <button class="uni-button" type="primary" size="mini">导出 Excel</button>
</view> </download-excel>
<view class="uni-container"> </view>
<unicloud-db ref="udb" :collection="collectionList" field="" :where="where" page-data="replace" </view>
:orderby="orderby" :getcount="true" :page-size="options.pageSize" :page-current="options.pageCurrent" <view class="uni-container">
v-slot:default="{data,pagination,loading,error,options}" :options="options" loadtime="manual" @load="onqueryload"> <unicloud-db ref="udb" :collection="collectionList" field="" :where="where" page-data="replace"
<uni-table ref="table" :loading="loading" :emptyText="error.message || '没有更多数据'" border stripe type="selection" @selection-change="selectionChange"> :orderby="orderby" :getcount="true" :page-size="options.pageSize" :page-current="options.pageCurrent"
<uni-tr> v-slot:default="{data,pagination,loading,error,options}" :options="options" loadtime="manual"
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" @load="onqueryload">
sortable @sort-change="sortChange($event, 'name')">用户名</uni-th> <uni-table ref="table" :loading="loading" :emptyText="error.message || '没有更多数据'" border stripe
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" type="selection" @selection-change="selectionChange">
sortable @sort-change="sortChange($event, 'name')">性别</uni-th> <uni-tr>
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" <uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
sortable @sort-change="sortChange($event, 'name')">密码</uni-th> sortable @sort-change="sortChange($event, 'name')">用户名</uni-th>
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" <uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
sortable @sort-change="sortChange($event, 'name')">手机号</uni-th> sortable @sort-change="sortChange($event, 'name')">性别</uni-th>
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" <uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
sortable @sort-change="sortChange($event, 'name')">学校</uni-th> sortable @sort-change="sortChange($event, 'name')">密码</uni-th>
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" <uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
sortable @sort-change="sortChange($event, 'name')">身份</uni-th> sortable @sort-change="sortChange($event, 'name')">手机号</uni-th>
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" <uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
sortable @sort-change="sortChange($event, 'name')">跑步总量</uni-th> sortable @sort-change="sortChange($event, 'name')">学校</uni-th>
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')" <uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
sortable @sort-change="sortChange($event, 'name')">健走总量</uni-th> sortable @sort-change="sortChange($event, 'name')">身份</uni-th>
<uni-th align="center">操作</uni-th> <uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
</uni-tr> sortable @sort-change="sortChange($event, 'name')">跑步总量</uni-th>
<uni-th align="center" filter-type="search" @filter-change="filterChange($event, 'name')"
<uni-tr v-for="(item,index) in data" :key="index"> sortable @sort-change="sortChange($event, 'name')">健走总量</uni-th>
<uni-td align="center">{{item.name}}</uni-td> <uni-th align="center">操作</uni-th>
<uni-td align="center">{{item.gender}}</uni-td> </uni-tr>
<uni-td align="center">{{item.password}}</uni-td>
<uni-td align="center">{{item.phone_num}}</uni-td> <uni-tr v-for="(item,index) in data" :key="index">
<uni-td align="center">{{item.school}}</uni-td> <uni-td align="center">{{item.name}}</uni-td>
<uni-td align="center">{{item.type[0].identity}}</uni-td> <uni-td align="center">{{item.gender}}</uni-td>
<uni-td align="center">{{item.total_running_distance}} km</uni-td> <uni-td align="center">{{item.password}}</uni-td>
<uni-td align="center">{{item.total_walking_distance}} km</uni-td> <uni-td align="center">{{item.phone_num}}</uni-td>
<uni-td align="center">{{item.school}}</uni-td>
<uni-td align="center"> <uni-td align="center">{{item.type[0].identity}}</uni-td>
<view class="uni-group"> <uni-td align="center">{{item.total_running_distance}} km</uni-td>
<button @click="navigateTo('./edit?id='+item._id, false)" class="uni-button" size="mini" type="primary">修改</button> <uni-td align="center">{{item.total_walking_distance}} km</uni-td>
<button @click="confirmDelete(item._id)" class="uni-button" size="mini" type="warn">删除</button>
</view> <uni-td align="center">
</uni-td> <view class="uni-group">
<button @click="navigateTo('./edit?id='+item._id, false)" class="uni-button" size="mini"
</uni-tr> type="primary">修改</button>
</uni-table> <button @click="confirmDelete(item._id)" class="uni-button" size="mini"
<view class="uni-pagination-box"> type="warn">删除</button>
<uni-pagination show-icon :page-size="pagination.size" v-model="pagination.current" :total="pagination.count" @change="onPageChanged" /> </view>
</view> </uni-td>
</unicloud-db>
</view> </uni-tr>
</view> </uni-table>
<view class="uni-pagination-box">
<uni-pagination show-icon :page-size="pagination.size" v-model="pagination.current"
:total="pagination.count" @change="onPageChanged" />
</view>
</unicloud-db>
</view>
</view>
</template> </template>
<script> <script>
import { enumConverter, filterToWhere } from '../../../js_sdk/validator/mustgo-user.js'; import {
enumConverter,
filterToWhere
} from '../../../js_sdk/validator/mustgo-user.js';
uniCloud.callFunction({
name: 'fe-sport-walk-rank',
data: {
startTime: "2023-04-28 11:13:54",
duration: 1000,
feelings: "good",
userId: "644a643a0c801ca878983559",
distance: 5.98,
pace: 5.1,
startPoint: {
"longitude": 116.39,
"latitude": 39.9
},
endPoint: {
"longitude": 117.9891,
"latitude": 40.98
},
pathLine: [{
"longitude": 116.39,
"latitude": 39.9
}, {
"longitude": 117.9891,
"latitude": 40.98
}]
}
})
.then(res => {
console.log(res);
});
const db = uniCloud.database() const db = uniCloud.database()
// 表查询配置 // 表查询配置
const dbOrderBy = '' // 排序字段 const dbOrderBy = '' // 排序字段
const dbSearchFields = [] // 模糊搜索字段,支持模糊搜索的字段列表。联表查询格式: 主表字段名.副表字段名,例如用户表关联角色表 role.role_name const dbSearchFields = [] // 模糊搜索字段,支持模糊搜索的字段列表。联表查询格式: 主表字段名.副表字段名,例如用户表关联角色表 role.role_name
// 分页配置 // 分页配置
const pageSize = 20 const pageSize = 20
const pageCurrent = 1 const pageCurrent = 1
const orderByMapping = { const orderByMapping = {
"ascending": "asc", "ascending": "asc",
"descending": "desc" "descending": "desc"
} }
export default { export default {
data() { data() {
return { return {
collectionList: "mustgo-user,mustgo-role", collectionList: "mustgo-user,mustgo-role",
query: '', query: '',
where: '', where: '',
orderby: dbOrderBy, orderby: dbOrderBy,
orderByFieldName: "", orderByFieldName: "",
selectedIndexs: [], selectedIndexs: [],
options: { options: {
pageSize, pageSize,
pageCurrent, pageCurrent,
filterData: {}, filterData: {},
...enumConverter ...enumConverter
}, },
imageStyles: { imageStyles: {
width: 64, width: 64,
height: 64 height: 64
}, },
exportExcel: { exportExcel: {
"filename": "mustgo-user.xls", "filename": "mustgo-user.xls",
"type": "xls", "type": "xls",
"fields": {} "fields": {}
}, },
exportExcelData: [] exportExcelData: []
} }
}, },
onLoad() { onLoad() {
this._filter = {} this._filter = {}
}, },
onReady() { onReady() {
this.$refs.udb.loadData() this.$refs.udb.loadData()
}, },
methods: { methods: {
onqueryload(data) { onqueryload(data) {
this.exportExcelData = data this.exportExcelData = data
}, },
getWhere() { getWhere() {
const query = this.query.trim() const query = this.query.trim()
if (!query) { if (!query) {
return '' return ''
} }
const queryRe = new RegExp(query, 'i') const queryRe = new RegExp(query, 'i')
return dbSearchFields.map(name => queryRe + '.test(' + name + ')').join(' || ') return dbSearchFields.map(name => queryRe + '.test(' + name + ')').join(' || ')
}, },
search() { search() {
const newWhere = this.getWhere() const newWhere = this.getWhere()
this.where = newWhere this.where = newWhere
this.$nextTick(() => { this.$nextTick(() => {
this.loadData() this.loadData()
}) })
}, },
loadData(clear = true) { loadData(clear = true) {
this.$refs.udb.loadData({ this.$refs.udb.loadData({
clear clear
}) })
}, },
onPageChanged(e) { onPageChanged(e) {
this.selectedIndexs.length = 0 this.selectedIndexs.length = 0
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$refs.udb.loadData({ this.$refs.udb.loadData({
current: e.current current: e.current
}) })
}, },
navigateTo(url, clear) { navigateTo(url, clear) {
// clear 表示刷新列表时是否清除页码,true 表示刷新并回到列表第 1 页,默认为 true // clear 表示刷新列表时是否清除页码,true 表示刷新并回到列表第 1 页,默认为 true
uni.navigateTo({ uni.navigateTo({
url, url,
events: { events: {
refreshData: () => { refreshData: () => {
this.loadData(clear) this.loadData(clear)
} }
} }
}) })
}, },
// 多选处理 // 多选处理
selectedItems() { selectedItems() {
var dataList = this.$refs.udb.dataList var dataList = this.$refs.udb.dataList
return this.selectedIndexs.map(i => dataList[i]._id) return this.selectedIndexs.map(i => dataList[i]._id)
}, },
// 批量删除 // 批量删除
delTable() { delTable() {
this.$refs.udb.remove(this.selectedItems(), { this.$refs.udb.remove(this.selectedItems(), {
success:(res) => { success: (res) => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
} }
}) })
}, },
// 多选 // 多选
selectionChange(e) { selectionChange(e) {
this.selectedIndexs = e.detail.index this.selectedIndexs = e.detail.index
}, },
confirmDelete(id) { confirmDelete(id) {
this.$refs.udb.remove(id, { this.$refs.udb.remove(id, {
success:(res) => { success: (res) => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
} }
}) })
}, },
sortChange(e, name) { sortChange(e, name) {
this.orderByFieldName = name; this.orderByFieldName = name;
if (e.order) { if (e.order) {
this.orderby = name + ' ' + orderByMapping[e.order] this.orderby = name + ' ' + orderByMapping[e.order]
} else { } else {
this.orderby = '' this.orderby = ''
} }
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.udb.loadData() this.$refs.udb.loadData()
}) })
}, },
filterChange(e, name) { filterChange(e, name) {
this._filter[name] = { this._filter[name] = {
type: e.filterType, type: e.filterType,
value: e.filter value: e.filter
} }
let newWhere = filterToWhere(this._filter, db.command) let newWhere = filterToWhere(this._filter, db.command)
if (Object.keys(newWhere).length) { if (Object.keys(newWhere).length) {
this.where = newWhere this.where = newWhere
} else { } else {
this.where = '' this.where = ''
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.udb.loadData() this.$refs.udb.loadData()
}) })
} }
} }
} }
</script> </script>
<style> <style>
</style> </style>
\ No newline at end of file
...@@ -10,7 +10,7 @@ exports.main = async (event, context) => { ...@@ -10,7 +10,7 @@ exports.main = async (event, context) => {
name: event.username, name: event.username,
gender: event.gender, gender: event.gender,
password: event.password, password: event.password,
phone_num: event.phone_num, phone_num: event.phone,
team_id: "", team_id: "",
school: event.school, school: event.school,
type: "644a64c228064a7587cd79bf", type: "644a64c228064a7587cd79bf",
......
...@@ -4,31 +4,34 @@ exports.main = async (event, context) => { ...@@ -4,31 +4,34 @@ exports.main = async (event, context) => {
console.log('event : ', event) console.log('event : ', event)
const db = uniCloud.database(); const db = uniCloud.database();
let fieldName;
if (event.type == "跑步") {
fieldName = "total_running_distance";
} else {
fieldName = "total_walking_distance";
}
const collection = db.collection('mustgo-user'); const collection = db.collection('mustgo-user');
// let {phone, password} = event
// let queryStringParameters = event.queryStringParameters
// let phone = queryStringParameters['phone']
// let password = queryStringParameters['password']
let res = await collection.where({ let res = await collection.orderBy(fieldName, "desc").get()
phone_num: event.phone console.log(res)
}).get()
console.log(res.data[0])
if (res.data[0]["password"] == event.password) for (let i = 0; i < res.data.length; i ++) {
return { if (res.data[i]["_id"] == event.userId) {
code: 200, return {
message: "登录成功", code: 200,
data: { message: "查询成功",
userId: res.data[0]["_id"] data :{
totalRunningDistance: res.data[i][fieldName],
totalRunningRank: i + 1
}
} }
} }
}
//返回数据给客户端 //返回数据给客户端
return { return {
code: 400, code: 500,
message: "用户名或密码错误", message: "服务器错误",
data: { data: {
} }
} }
......
{ {
"name": "register", "name": "fe-sport-run-index",
"dependencies": {}, "dependencies": {},
"extensions": { "extensions": {
"uni-cloud-jql": {} "uni-cloud-jql": {}
......
...@@ -2,29 +2,29 @@ ...@@ -2,29 +2,29 @@
exports.main = async (event, context) => { exports.main = async (event, context) => {
//event为客户端上传的参数 //event为客户端上传的参数
console.log('event : ', event) console.log('event : ', event)
const db = uniCloud.database(); const db = uniCloud.database();
const collection = db.collection('mustgo-user'); const collection = db.collection('mustgo-user');
let res = await collection.where({ let res = await collection.orderBy("total_running_distance", "desc").get()
phone_num: event.phone console.log(res)
}).get()
console.log(res.data[0]) let userlist = new Array;
for (let i = 0; i < res.data.length; i++) {
if (res.data[0]["password"] == event.password) let user = {
return { "icon": res.data[i]["icon"],
code: 200, "username": res.data[i]["name"],
message: "登录成功", "distance":res.data[i]["total_running_distance"]
data: {
userId: res.data[0]["_id"]
}
} }
userlist.push(user)
}
//返回数据给客户端 //返回数据给客户端
return { return {
code: 400, "code": 200,
message: "用户名或密码错误", "message": "成功返回跑步累计排名",
data: { "data": {
} "userList": userlist
} }
}; }
};
\ No newline at end of file
{ {
"name": "object-register", "name": "fe-sport-run-rank",
"dependencies": {}, "dependencies": {},
"extensions": { "extensions": {
"uni-cloud-jql": {} "uni-cloud-jql": {}
......
'use strict';
exports.main = async (event, context) => {
//event为客户端上传的参数
console.log('event : ', event)
const db = uniCloud.database();
let collection = db.collection('mustgo-running-record');
let res = await collection.add({
start_date: event.startTime,
duration: event.duration,
feelings: event.feelings,
owner_id: event.userId,
distance: event.distance,
pace: event.pace,
start_point: event.startPoint,
end_point: event.endPoint,
path_line: event.pathLine
})
console.log(res)
// userID
collection = db.collection('mustgo-user');
res = await collection.where({
_id: event.userId
}).get()
// console.log(res)
let cur = res.data[0]["total_running_distance"];
cur += event.distance
res = await collection.doc(event.userId).update({
total_running_distance: cur,
})
if (res.updated > 0)
return {
code: 200,
message: "保存成功",
data: {
}
}
//返回数据给客户端
return {
code: 500,
message: "服务器错误",
data: {
}
}
};
{ {
"name": "auth", "name": "fe-sport-run-save",
"dependencies": {}, "dependencies": {},
"extensions": { "extensions": {
"uni-cloud-jql": {} "uni-cloud-jql": {}
......
...@@ -2,33 +2,29 @@ ...@@ -2,33 +2,29 @@
exports.main = async (event, context) => { exports.main = async (event, context) => {
//event为客户端上传的参数 //event为客户端上传的参数
console.log('event : ', event) console.log('event : ', event)
const db = uniCloud.database(); const db = uniCloud.database();
const collection = db.collection('mustgo-user'); const collection = db.collection('mustgo-user');
let res = await collection.add({ let res = await collection.orderBy("total_walking_distance", "desc").get()
name: event.username, console.log(res)
gender: event.gender,
password: event.password, let userlist = new Array;
phone_num: event.phone_num, for (let i = 0; i < res.data.length; i++) {
school: event.school let user = {
}) "icon": res.data[i]["icon"],
console.log(res.updated) "username": res.data[i]["name"],
"distance":res.data[i]["total_walking_distance"]
if (res.updated > 0)
return {
code: 200,
message: "注册成功",
data: {
}
} }
userlist.push(user)
}
//返回数据给客户端 //返回数据给客户端
return { return {
code: 400, "code": 200,
message: "注册失败", "message": "成功返回健走累计排名",
data: { "data": {
} "userList": userlist
} }
}; }
};
\ No newline at end of file
{ {
"name": "auth", "name": "fe-sport-walk-rank",
"dependencies": {}, "dependencies": {},
"extensions": { "extensions": {
"uni-cloud-jql": {} "uni-cloud-jql": {}
......
'use strict';
exports.main = async (event, context) => {
//event为客户端上传的参数
console.log('event : ', event)
const db = uniCloud.database();
let collection = db.collection('mustgo-walking-record');
let res = await collection.add({
start_date: event.startTime,
duration: event.duration,
feelings: event.feelings,
owner_id: event.userId,
distance: event.distance,
pace: event.pace,
start_point: event.startPoint,
end_point: event.endPoint,
path_line: event.pathLine
})
console.log(res)
// userID
collection = db.collection('mustgo-user');
res = await collection.where({
_id: event.userId
}).get()
// console.log(res)
let cur = res.data[0]["total_walking_distance"];
cur += event.distance
res = await collection.doc(event.userId).update({
total_walking_distance: cur,
})
if (res.updated > 0)
return {
code: 200,
message: "保存成功",
data: {
}
}
//返回数据给客户端
return {
code: 500,
message: "服务器错误",
data: {
}
}
};
{
"name": "fe-sport-walk-save",
"dependencies": {},
"extensions": {
"uni-cloud-jql": {}
}
}
\ No newline at end of file
// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程:https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
module.exports = {
_before: function () { // 通用预处理器
},
/**
* register 方法描述
*/
login(phone, password) {
phone = phone.trim()
password = password.trim()
if (!phone || !password) {
return {
code: '400',
message: '用户名或密码错误'
}
}
// 业务逻辑
// 返回结果
return {
code: '200',
message: '登录成功'
}
}
}
{"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": true,
"update": true,
"delete": true
},
"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": "object",
"title": "起始地点",
"description": "运动起始地点,经纬度"
},
"end_point": {
"bsonType": "object",
"title": "结束地点",
"description": "运动结束地点,经纬度"
},
"path_line": {
"bsonType": "array",
"title": "路线",
"description": "运动路线"
}
}
}
\ No newline at end of file
<<<<<<< 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", "bsonType": "object",
"required": [], "required": [],
"permission": { "permission": {
"read": false, "read": true,
"create": true, "create": true,
"update": false, "update": true,
"delete": false "delete": true
}, },
"properties": { "properties": {
"_id": { "_id": {
"title": "id",
"description": "ID,系统自动生成" "description": "ID,系统自动生成"
}, },
"name": { "name": {
"bsonType": "string" "bsonType": "string",
"title": "姓名",
"description": "用户姓名"
}, },
"icon": { "icon": {
"bsonType": "string", "bsonType": "string",
"description": "用户头像", "title": "头像",
"defaultValue": "https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/0510a534-dd8d-41f0-8341-601aa677e243.jpg" "description": "用户头像"
}, },
"gender": { "gender": {
"bsonType": "string" "bsonType": "string",
"title": "性别",
"description": "用户性别"
}, },
"password": { "password": {
"bsonType": "string" "bsonType": "string",
"title": "密码",
"description": "用户密码"
}, },
"phone_num": { "phone_num": {
"bsonType": "string" "bsonType": "string",
"title": "手机号码",
"description": "用户手机号码"
}, },
"team_id": { "team_id": {
"bsonType": "string", "bsonType": "string",
"defaultValue": "" "defaultValue": "",
"title": "小队id",
"description": "用户所属小队id"
}, },
"school": { "school": {
"bsonType": "string" "bsonType": "string",
"title": "学校",
"description": "用户所属学校"
}, },
"type": { "type": {
"bsonType": "string", "bsonType": "string",
"foreignKey": "mustgo-role._id" "foreignKey": "mustgo-role._id",
"title": "类型",
"description": "用户类型"
}, },
"total_running_distance": { "total_running_distance": {
"bsonType": "double", "bsonType": "double",
"defaultValue": 0 "defaultValue": 0,
"title": "总跑步距离",
"description": "用户总跑步距离"
}, },
"total_walking_distance": { "total_walking_distance": {
"bsonType": "double", "bsonType": "double",
"defaultValue": 0 "defaultValue": 0,
"title": "总健走距离",
"description": "用户总健走距离"
} }
} }
} }
>>>>>>> 9039ca03ce0a452fbd2b009e72becba2ca46c23b \ No newline at end of file
{"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": true,
"update": true,
"delete": true
},
"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": "运动距离"
},
"steps": {
"bsonType": "int",
"title": "步数",
"description": "健走步数"
},
"start_point": {
"bsonType": "object",
"title": "起始地点",
"description": "运动起始地点,经纬度"
},
"end_point": {
"bsonType": "object",
"title": "结束地点",
"description": "运动结束地点,经纬度"
},
"path_line": {
"bsonType": "array",
"title": "路线",
"description": "运动路线"
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册