由于是接手的项目,目前只收录添加的API,后续有时间将逐步完善。
服务器 hostname 列表:
阿里云测试服务器: 101.201.234.233:4001
台北测试服务器: 61.218.20.233
官服
BXC 内部测试服务器:10.180.3.24:4001
BXC DEBUG 服务器:10.180.3.27:4001(有线) 192.168.30.10:4001(无线)
Request Header
Host: http://host:port/v1
Content-Type: application/json
Response Header
800|UndefError|
801|TokenValidationErr
802|DBError
803|RequiredDataMissing
804|InvalidParameterFormat
805|FileSystemError
806|FileNotExist
807|UpdateIdNotExist
808|DeleteIdNotExist
809|TokenExpiredError
1001|AccountUsed
1002|SmsRegLimitation
1003|PhoneRegLimitation
1004|AccountRequired
1005|PasswordRequired
1006|PassportAuthErr
1007|InvalidLoginInfo
1010|ChangePasswordFail
1011|InvalidPassword
1012|InvalidBirthday
1013|InvalidGender
1014|InvalidID
1015|InvalidHeight
1016|InvalidWeight
1017|InvalidActivityIntensity
1018|InvalidEmail
1019|InvalidCellPhone
1020|UpdateUserPropErr
1021|InvalidVerifyID
1022|VerifyCodeErr
1023|VerifyCodeExpired
1024|RequestCodeLimitation
1025|AccountNotFound
1026|ResetPasswordLimitation
1027|PropertiesRequired
1028|CellPhoneRequired
1029|RefreshTokenSignError
1030|RefreshTokenIdError
1031|BindingHasExist
1032|UnSupportAccountType
1033|NoEnoughIcon
Url: /user/loginByThirdPart
param |
type |
nullable |
description |
accountType |
int |
false |
google(1), facebook(2), instagram(3), line(4), newbei(5) |
uid |
string |
false |
第三方账号ID |
name |
string |
false |
第三方账号名称 |
accesstoken |
string |
false |
第三方账号存取权杖 |
email |
string |
true |
第三方账号注册mail |
icon |
string |
true |
第三方账号头像url |
device |
string |
true |
device |
param |
type |
description |
success |
bool |
是否成功 |
token |
string |
存取token |
refreshToken |
string |
刷新token |
tokenExpireIn |
string |
token 有效时间 |
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
description |
success |
bool |
是否成功 |
accounts |
Array |
账号数据数组, 如果没有绑定第三方,数组为空,内部item格式与登录传入参数意义相同。 |
Url: /user/bind3rdAccount
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
accountType |
int |
false |
google(1), facebook(2), instagram(3), line(4), newbei(5) |
uid |
string |
false |
第三方账号ID |
name |
string |
false |
第三方账号名称 |
accesstoken |
string |
false |
第三方账号存取权杖 |
email |
string |
true |
第三方账号注册mail |
icon |
string |
true |
第三方账号头像url |
param |
type |
description |
success |
bool |
是否成功 |
Url: /user/unbind3rdAccount
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
accountType |
int |
false |
google(1), facebook(2), instagram(3), line(4), newbei(5) |
uid |
string |
false |
第三方账号ID |
param |
type |
description |
success |
bool |
是否成功 |
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
description |
success |
bool |
是否成功 |
data._id |
string |
id |
data.goal |
number |
目标步数 |
Url: /walkGoal/updateData
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_id |
string |
false |
id |
goal |
number |
false |
目标步数 |
param |
type |
description |
success |
bool |
是否成功 |
```
request:
{
"_id": "596ec9bf0b17a40604a71cab",
"goal": 16000
}
```
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
dataSource |
number |
false |
phone(1) belt(2), other(3) |
data |
array |
false |
目标步数数组 |
startTime |
string |
false |
开始时间UTC |
endTime |
string |
false |
结束时间UTC |
steps |
number |
false |
步数 |
param |
type |
description |
success |
bool |
是否成功 |
data.insertedCount |
number |
插入数量 |
data.insertedIds |
array |
插入步数记录ids |
request:
{
"dataSource": 2,
"data": [
{"steps": 1200, "startTime": "2017-07-18T05:10:10Z", "endTime": "2017-07-18T05:30:10Z"},
{"steps": 1300, "startTime": "2017-07-19T08:10:10Z", "endTime": "2017-07-19T08:30:10Z"}
]
}
response:
{
"success": true,
"data": {
"insertedCount": 2,
"insertedIds": [
"5971570ac60492e20223a421",
"5971570ac60492e20223a422"
]
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
dataSource |
number |
true |
phone(1) belt(2), other(3) 不传获取所有来源 |
date |
string |
false |
指定日期UTC |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标步数数组 |
_id |
class |
按小时分组的hour字段 |
steps |
number |
每小时步数总计 |
request:
{
"dataSource":1,
"date":"2017-07-19T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": {
"hour": 0
},
"steps": 2500
},
{
"_id": {
"hour": 5
},
"steps": 1200
},
{
"_id": {
"hour": 8
},
"steps": 1500
},
{
"_id": {
"hour": 15
},
"steps": 2400
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
dataSource |
number |
true |
phone(1) belt(2), other(3) 不传获取所有来源 |
date |
string |
false |
指定日期UTC |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标步数数组 |
_id |
class |
按天分组的year, month,day,附带dayOfWeek字段 |
dayOfWeek |
number |
周日(1) ---- 周六(7) |
steps |
number |
每日步数总计 |
request:
{
"dataSource":1,
"date":"2017-07-18T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": {
"dayOfWeek": 3
},
"steps": 1200
},
{
"_id": {
"dayOfWeek": 4
},
"steps": 1200
},
{
"_id": {
"dayOfWeek": 5
},
"steps": 1300
}
]
}
Url: /walk/getDataByMonth
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
dataSource |
number |
true |
phone(1) belt(2), other(3) 不传获取所有来源 |
date |
string |
false |
指定日期UTC |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标步数数组 |
_id |
class |
按天分组的year, month,day 字段 |
steps |
number |
每日步数 |
request:
{
"dataSource":1,
"date":"2017-07-18T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": {
"year": 2017,
"month": 7,
"day": 10
},
"steps": 2700
},
{
"_id": {
"year": 2017,
"month": 7,
"day": 12
},
"steps": 1200
},
{
"_id": {
"year": 2017,
"month": 7,
"day": 13
},
"steps": 1300
},
{
"_id": {
"year": 2017,
"month": 7,
"day": 18
},
"steps": 1200
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标数组 |
item.lv |
number |
0 表示无排名 |
item.total |
number |
今日运动人数 |
request:
{
}
response:
{
"success": true,
"data": {
"lv": 0,
"total": 1
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
data |
array |
false |
目标数组 |
startTime |
string |
false |
开始时间UTC |
endTime |
string |
false |
结束时间UTC |
quality |
number |
false |
浅睡(1) 中睡(2), 深睡(3) 人工(4) |
param |
type |
description |
success |
bool |
是否成功 |
data.insertedCount |
number |
插入数量 |
data.insertedIds |
array |
插入记录ids |
request:
{
"data": [
{"quality": 4, "startTime": "2017-08-01T13:00:00Z", "endTime": "2017-08-01T14:00:10Z"},
{"quality": 1, "startTime": "2017-08-01T14:30:00Z", "endTime": "2017-08-01T15:00:10Z"},
]
}
response:
{
"success": true,
"data": {
"insertedCount": 2,
"insertedIds": [
"5971570ac60492e20223a421",
"5971570ac60492e20223a422"
]
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
指定日期UTC |
count |
bool |
true |
如果指定且为True,将返回当日的统计数据 |
quality |
Number |
true |
如果指定,将返回指定类型的数据 |
refresh |
string |
true |
如果指定,强制刷新数据 |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
_id |
class |
|
startTime |
String |
UTC格式,注意转换 |
endTime |
String |
UTC格式,注意转换 |
quality |
number |
睡眠类型 |
duration |
number |
按分钟统计的数据 |
request:
{
"date":"2017-08-15T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": "59913bd9df5639f605d1f0e1",
"duration": 60,
"startTime": "2017-08-14T13:00:00.000Z",
"endTime": "2017-08-14T14:00:10.000Z",
"quality": 4
},
{
"_id": "59913bd9df5639f605d1f0e2",
"duration": 30,
"startTime": "2017-08-14T14:30:00.000Z",
"endTime": "2017-08-14T15:00:10.000Z",
"quality": 1
}
]
}
Url: /sleep/getDataByWeek
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
指定日期UTC |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
_id |
class |
按天分组的year, month,day,附带dayOfWeek字段 |
dayOfWeek |
number |
周日(1) ---- 周六(7) |
sleep |
array |
item 包含quality 和 duration 数据 |
request:
{
"date":"2017-08-15T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": {
"year": 2017,
"month": 8,
"day": 14,
"dayOfWeek": 2
},
"sleep": [
{
"quality": 2,
"duration": 320
},
{
"quality": 1,
"duration": 239
},
{
"quality": 4,
"duration": 180
},
{
"quality": 3,
"duration": 90
}
]
}
]
}
Url: /sleep/getDataByMonth
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
指定日期UTC |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
_id |
class |
按天分组的year, month,day 字段 |
sleep |
array |
item 包含quality 和 duration 数据 |
request:
{
"date":"2017-08-15T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": {
"year": 2017,
"month": 8,
"day": 2
},
"sleep": [
{
"quality": 4,
"duration": 90
},
{
"quality": 2,
"duration": 120
},
{
"quality": 1,
"duration": 110
},
{
"quality": 3,
"duration": 45
}
]
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
counts |
int |
false |
获取记录的条数 |
timeStamp |
string |
false |
指定起始时间UTC之后的记录 ( "2016-10-01T16:00:00.000Z" ) |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
sequence |
number |
显示次序 |
systemType |
bool |
系统创建 |
request:
{
"counts": 100,
"timeStamp":"2016-11-20T08:43:28.872Z"
}
response:
{
"success": true,
"data": [
{
"_id": "000000000000000000000005",
"foodTypeName": "油脂堅果類",
"foodUnitName": "份",
"foodTypeNote": "NewTaipei",
"sequence": 6,
"iconUrl": "https://f4a.tw/v1/food/downloadphoto?filename=c60fb2e8-e17d-4e9f-b593-8d4a6a2f6eab",
"webIcon": "/images/food/c60fb2e8-e17d-4e9f-b593-8d4a6a2f6eab-_@food_img_oil.png",
"timeStamp": "2016-11-23T02:27:07.238Z",
"systemType": true
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
counts |
int |
false |
获取记录的条数 |
timeStamp |
string |
false |
指定起始时间UTC 之后的记录("2016-08-27T16:00:00.000Z") |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
item.foodTypeID |
string |
类型id |
item.foodItemName |
string |
食物名称 |
item.foodItemCalories |
number |
食物卡路里 |
request:
{
"counts": 100,
"timeStamp":"2016-11-20T08:43:28.872Z"
}
response:
{
"success": true,
"data": [
{
"_id": "000000000000000000000005",
"foodTypeName": "油脂堅果類",
"foodUnitName": "份",
"foodTypeNote": "NewTaipei",
"sequence": 6,
"iconUrl": "https://f4a.tw/v1/food/downloadphoto?filename=c60fb2e8-e17d-4e9f-b593-8d4a6a2f6eab",
"webIcon": "/images/food/c60fb2e8-e17d-4e9f-b593-8d4a6a2f6eab-_@food_img_oil.png",
"timeStamp": "2016-11-23T02:27:07.238Z",
"systemType": true
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
foodTypeID |
string |
false |
id |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
item.foodTypeID |
string |
类型id |
item.foodItemName |
string |
食物名称 |
item.foodItemCalories |
number |
食物卡路里 |
request:
{
"foodTypeID": "000000000000000000000000"
}
response:
{
"success": true,
"data": [
{
"_id": "000000000000000000000000",
"foodTypeID": "000000000000000000000000",
"foodItemName": "飯",
"foodItemCalories": 71,
"foodUnitName": "一份=1/4碗 (50g)",
"iconUrl": "https://f4a.tw/v1/food/downloadphoto?filename=dab5366b-d410-48c9-8471-b24d4ce439c8",
"webIcon": "/images/food/dab5366b-d410-48c9-8471-b24d4ce439c8-_@l_food_img_rice.png",
"timeStamp": "2016-11-23T02:28:13.199Z",
"readonly": true,
"recordBy": null,
"isDeleted": false,
"foodTypeDetail": [],
"systemItem": true
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
就餐日期UTC |
foodItemID |
string |
false |
食物item id |
foodItemValue |
number |
false |
食物的份数 |
param |
type |
description |
success |
bool |
是否成功 |
_id |
string |
item id |
request:
{
"date" : "2017/08/15",
"foodItemID" : "00000000000000000000005b",
"foodItemValue" : 10
}
response:
{
"success": true,
"_id": "59955d96565c127f081be16f"
}
Url: /food/createBaseData
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
日期UTC |
foods |
array |
false |
目标数组 |
type |
number |
false |
蔬(1) 果(2) 蛋白(3) 水(4) |
value |
number |
false |
份数 |
param |
type |
description |
success |
bool |
是否成功 |
data.insertedCount |
number |
插入数量 |
data.insertedIds |
array |
插入记录ids |
request: //添加 1份蔬菜 2分蛋白
{
"date" : "2017-08-25T13:49:00.000Z",
"foods" : [
{"type": 1, "value": 1},
{"type": 3, "value": 2}
]
}
response:
{
"success": true,
"data": {
"insertedCount": 2,
"insertedIds": [
"599d4477eb4dbf3e081938df",
"599d4477eb4dbf3e081938e0"
]
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_id |
string |
false |
饮食条目id |
date |
string |
true |
就餐日期 |
foodItemID |
string |
true |
食物item id |
foodItemValue |
number |
true |
食物的份数 |
param |
type |
description |
success |
bool |
是否成功 |
_id |
string |
item id |
request:
{
"_id" : "599568ffa7ec2c1378491819",
"date" : "2017/08/16",
"foodItemValue" : 8
}
response:
{
"success": true,
"_id": "599568ffa7ec2c1378491819"
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_id |
string |
false |
饮食条目id |
param |
type |
description |
success |
bool |
是否成功 |
_id |
string |
item id |
request:
{
"_id" : "599568ffa7ec2c1378491819",
}
response:
{
"success": true,
"_id": "599568ffa7ec2c1378491819"
}
Url: /food/deleteManyData
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_idArr |
array |
false |
饮食条目id 数组 |
param |
type |
description |
success |
bool |
是否成功 |
_id |
object |
update相关信息 |
request:
{
"_idArr":[
"599f9c012922c51f0333b327",
"599f9c012922c51f0333b326"
]
}
response:
{
"success": true,
"_id": {
"n": 2,
"nModified": 2,
"ok": 1
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
Object |
foodTypeID |
string |
食物类型ID |
unit |
number |
份数 |
request:
{
"contentID" : "000000000000000000000012"
}
response:
{
"success": true,
"data":
{
"calories": 1800,
"units": [
{
"foodTypeID": "000000000000000000000000",
"unit": 3
},
{
"foodTypeID": "000000000000000000000002",
"unit": 5
},
{
"foodTypeID": "000000000000000000000001",
"unit": 1.5
},
{
"foodTypeID": "000000000000000000000003",
"unit": 3
},
{
"foodTypeID": "000000000000000000000004",
"unit": 2
},
{
"foodTypeID": "000000000000000000000005",
"unit": 5
}
]
}
}
Url: /food/getGroupDataByDay
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
指定日期UTC |
2017/08/15 |
|
|
|
param |
type |
description |
success |
bool |
是否成功 |
foods |
array |
目标数组 |
foodItemID |
string |
食物ID |
foodItemValue |
number |
份数 |
_id |
string |
饮食ID |
request:
{
"date":"2017-07-18T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"foodTypeID": "000000000000000000000000",
"foods": [
{
"date": "2016-08-15T07:01:20.580Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "000000000000000000000004",
"foodItemValue": 1
}
]
},
{
"foodTypeID": "000000000000000000000001",
"foods": [
{
"date": "2016-08-15T08:01:20.580Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "000000000000000000000014",
"foodItemValue": 1
}
]
},
{
"foodTypeID": "000000000000000000000002",
"foods": [
{
"date": "2016-08-15T07:01:20.580Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "00000000000000000000001c",
"foodItemValue": 1
}
]
},
{
"foodTypeID": "000000000000000000000003",
"foods": [
{
"date": "2016-08-15T07:01:20.580Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "00000000000000000000003a",
"foodItemValue": 1
}
]
},
{
"foodTypeID": "000000000000000000000004",
"foods": [
{
"date": "2016-08-15T07:01:20.580Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "000000000000000000000053",
"foodItemValue": 1
}
]
},
{
"foodTypeID": "000000000000000000000005",
"foods": [
{
"date": "2016-08-15T07:01:20.580Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "00000000000000000000006c",
"foodItemValue": 1
}
]
}
]
}
Url: /food/getGroupDataByWeek
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
指定日期UTC |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
_id |
class |
按天分组的year, month,day,附带dayOfWeek字段 |
dayOfWeek |
number |
周日(1) ---- 周六(7) |
foods |
array |
item foodTypeID 和 totalValue, _id 数据 |
request:
{
"date":"2017-08-15T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": {
"year": 2017,
"month": 8,
"day": 14,
"dayOfWeek": 2
},
"foods": [
{
"foodTypeID": "000000000000000000000002",
"items": [
{
"date": "2017-08-23T16:00:00.000Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "00000000000000000000001c",
"foodItemValue": 3
}
]
},
{
"foodTypeID": "000000000000000000000003",
"items": [
{
"date": "2017-08-23T16:00:00.000Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "000000000000000000000041",
"foodItemValue": 1
}
]
}
]
}
]
}
Url: /food/getGroupDataByMonth
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
false |
指定日期UTC |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
_id |
class |
按天分组的year, month,day 字段 |
foods |
array |
item foodTypeID 和 totalValue, _id数据 |
request:
{
"date":"2017-08-15T00:00:00Z"
}
response:
{
"success": true,
"data": [
{
"_id": {
"year": 2017,
"month": 8,
"day": 2
},
"foods": [
{
"foodTypeID": "000000000000000000000002",
"items": [
{
"date": "2017-08-23T16:00:00.000Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "00000000000000000000001c",
"foodItemValue": 3
}
]
},
{
"foodTypeID": "000000000000000000000003",
"items": [
{
"date": "2017-08-23T16:00:00.000Z",
"_id": "599fa6cbe4603985035b6485",
"foodItemID": "000000000000000000000041",
"foodItemValue": 1
}
]
}
}
]
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
name |
string |
false |
查找字串 |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
item.foodTypeID |
string |
类型id |
item.foodItemName |
string |
食物名称 |
item.foodItemCalories |
number |
食物卡路里 |
request:
{
"name" :"果"
}
response:
{
"success": true,
"data": [
{
"_id": "000000000000000000000055",
"foodTypeID": "000000000000000000000004",
"foodItemName": "青龍蘋果(小)",
"foodItemCalories": 61,
"foodUnitName": "一份=1個 (130g)",
"iconUrl": "https://f4a.tw/v1/food/downloadphoto?filename=8da7859e-898e-413d-a0f6-b0fd9bfe7aab",
"webIcon": "/images/food/8da7859e-898e-413d-a0f6-b0fd9bfe7aab-_@l_food_img_apple_fuji.png",
"timeStamp": "2016-11-23T02:29:38.195Z",
"readonly": true,
"recordBy": null,
"isDeleted": false,
"foodTypeDetail": [],
"systemItem": true
},
{
"_id": "000000000000000000000057",
"foodTypeID": "000000000000000000000004",
"foodItemName": "百香果",
"foodItemCalories": 62,
"foodUnitName": "一份=約2個 (190g)",
"iconUrl": "https://f4a.tw/v1/food/downloadphoto?filename=3b546aae-0965-4d26-8ba4-476c325ee972",
"webIcon": "/images/food/3b546aae-0965-4d26-8ba4-476c325ee972-_@l_food_img_passion_fruit.png",
"timeStamp": "2016-11-23T02:29:40.196Z",
"readonly": true,
"recordBy": null,
"isDeleted": false,
"foodTypeDetail": [],
"systemItem": true
}
]
}
Url: /food/getMonthReport
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
true |
指定日期UTC, 如果不填,默认当月 |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
item.foodTypeID |
string |
类型id |
item.standardValue |
number |
标准参考值 |
item.value |
number |
实际值 |
item.range |
number |
区间 (0)<=80% (1) <=100% (2)>100% |
item.msg |
string |
提示信息 |
request:
{
"date":"2017-08-27T16:00:00.000Z"
}
response:
{
"success": true,
"data": [
{
"fontTypeID": "000000000000000000000000",
"standardValue": 93,
"value": 0,
"range": 0,
"msg": "碳水化合物其實很重要,可以提供身體一天所需能量,應該吃得巧而不是完全避免;建議食用未精緻、含麩皮的全穀或以根莖類取代精緻過的白飯、白麵、麵包。"
},
{
"fontTypeID": "000000000000000000000002",
"standardValue": 155,
"value": 66,
"range": 0,
"msg": "蛋白質是肌肉、組織、骨骼和牙齒組成的重要來源! 攝取不足則容易造成發育不良、水腫、貧血、對疾病抵抗力弱、易疲倦等症狀。建議攝取好的奶類、豆類、蛋類、魚類、肉類、豆製品以獲取優質蛋白質喔!"
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
type |
string |
false |
食物类别 蔬(1) 果(2) 蛋白(3) 水(4) |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标数组 |
item.lv |
number |
0 表示未达标 1 达标 |
item.total |
number |
今日人数 |
request:
{
"type" : 3
}
response:
{
"success": true,
"data": {
"lv": 1,
"total": 2
}
}
Url: /sports/getItemByName
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
name |
string |
false |
查找字串 |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
目标数组 |
item.sportsTypeID |
array |
运动类型id 数组 |
item.sportsItemName |
string |
**名称 |
item.itemCalories |
number |
卡路里 |
request:
{
"name" :"球"
}
response:
{
"success": true,
"data": [
{
"_id": "00000000000000000000000e",
"sportsItemName": "排球",
"itemCalories": 3.6,
"itemNote": "大卡/公斤體重/小時",
"timeStamp": "2016-11-23T02:19:06.850Z",
"readonly": true,
"recordBy": null,
"isDeleted": false,
"iconUrl": {
"btnNormal": "https://f4a.tw/v1/sports/downloadphoto?filename=c473130f-0435-43bf-94f8-77f444db6391",
"btnPressed": "https://f4a.tw/v1/sports/downloadphoto?filename=49f4c5b5-5f46-4616-9003-02d8491c51b7",
"img": "https://f4a.tw/v1/sports/downloadphoto?filename=bfd7c5f7-1d30-4953-8c3c-b5545c8280a1"
},
"sportsTypeID": [
"000000000000000000000000",
"000000000000000000000001"
],
"systemItem": true
},
{
"_id": "00000000000000000000000f",
"sportsItemName": "保齡球",
"itemCalories": 3.6,
"itemNote": "大卡/公斤體重/小時",
"timeStamp": "2016-11-23T02:19:07.851Z",
"readonly": true,
"recordBy": null,
"isDeleted": false,
"iconUrl": {
"btnNormal": "https://f4a.tw/v1/sports/downloadphoto?filename=93871a47-5862-46e2-b99d-5ef8c915932f",
"btnPressed": "https://f4a.tw/v1/sports/downloadphoto?filename=65e51278-d87e-45e5-926f-88704e29cff9",
"img": "https://f4a.tw/v1/sports/downloadphoto?filename=f1f9b877-8025-45bd-8906-e921f0842374"
},
"sportsTypeID": [
"000000000000000000000000",
"000000000000000000000001"
],
"systemItem": true
}
]
}
Url: /sports/getMonthReport
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
true |
指定日期UTC, 如果不填,默认当月 |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标数组 |
score |
object |
类型id 字段对应相应的运动类型, 依次是有氧,平衡,柔软,阻力,敏捷 |
suggest |
object |
建议项, 字段 bsq 是平衡,柔软,敏捷3in1 |
request:
{
"date":"2017-08-27T16:00:00.000Z"
}
response:
{
"success": true,
"data": {
"score": {
"000000000000000000000000": 0,
"000000000000000000000001": 0,
"000000000000000000000002": 0,
"000000000000000000000003": 0,
"000000000000000000000004": 0,
"walk": 13
},
"suggest": {
"000000000000000000000000": "每週完成至少150分鐘有氧身體活動",
"000000000000000000000003": "每週至少應有2天進行大肌群參與的增強肌肉力量的活動",
"bsq": "活動能力較差者,每週至少應有3天進行增強平衡能力和預防跌倒的活動",
"walk": "走路」被稱之為最完美的**,不但沒有年齡限制,還能隨時隨地進行;能增強心肺功能、提高代謝、預防肥胖、控制體重、 預防高血脂、高血壓、 強化免疫系統、預防及控制糖尿病、遠離憂鬱 天天好心情。日行萬步好處多,你還不GO嗎?"
}
}
}
Url: /sports/getTodayRank
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标数组 |
item.lv |
number |
0 表示无排名 |
item.total |
number |
今日运动人数 |
request:
{
}
response:
{
"success": true,
"data": {
"lv": 0,
"total": 1
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
date |
string |
true |
指定日期UTC,不传默认当日 |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
mode |
number |
积分模式:0(蔬菜)1(水果) 2(蛋白) 3(水) 4(步)5(睡) |
score |
number |
得分 |
msg |
string |
提示信息 |
request:
{
"date" :"球"
}
response:
{
"success": true,
"data": {
"msg": "主人~今天蛋白質的基本份量達到了!",
"score": 11,
"mode": 0
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
Array |
item._id |
string |
商品购买id, buyPetGoods 请求需要 |
item.thumb |
string |
缩略图 |
item.type |
Number |
物品类型 (1)"寵物", (2)"飼料盒", (3)"小窩",(4)"玩具",(5)"坐墊",(6)"花束",(7)"飾品",(8)"服飾",(9)"窗簾",(10)"牆壁", (11)"地板", (12)"神奇藥水" |
item.typeName |
string |
物品类型名称 |
item.score |
string |
购买所需health icon. |
item.goodsNo |
String |
物品ID ,与MyGoods API 返回的 goodsNo一致,用于判断此商品是否可继续购买。 |
request:
{
}
response:
{
"success": true,
"data": [
{
"_id": "59f1d100d368989c13fcb5cf",
"title": "動動狗",
"score": 150,
"type": 1,
"thumb": "http://101.201.234.233/v1/pet/downloadphoto?filename=e74bf82a-a19d-402d-944e-ecd77ccfceba",
"goodsNo": "000000000000000000000000",
"typeName": "寵物"
},
{
"_id": "59f1d100d368989c13fcb5d0",
"title": "健健貓",
"score": 150,
"type": 1,
"thumb": "http://101.201.234.233/v1/pet/downloadphoto?filename=10db6b07-7134-45d3-bcb8-f676e7223d9b",
"goodsNo": "000000000000000000000001",
"typeName": "寵物"
},
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
Array |
item.type |
Number |
物品类型 (1)"寵物", (2)"飼料盒", (3)"小窩",(4)"玩具",(5)"坐墊",(6)"花束",(7)"飾品",(8)"服飾",(9)"窗簾",(10)"牆壁", (11)"地板", (12)"神奇藥水" |
item.title |
string |
物品名称 |
item.goodsNo |
String |
物品ID ,lstGoods API 返回的 goodsNo一致,用于判断此商品是否可继续购买。 |
item.validDays |
Number |
有效天数 |
request:
{
}
response:
{
"success": true,
"data": [
{
"_id": "5a1e4df5f55916075474d8ee",
"goodsNo": "000000000000000000000013",
"type": 5,
"title": "絨布柔軟加厚坐墊"
},
{
"_id": "5a1e4df5f55916075474d8ee",
"goodsNo": "000000000000000000000017",
"type": 6,
"title": "豪華花束 (10 天)",
"validDays": 10
},
{
"_id": "5a1e4df5f55916075474d8ee",
"goodsNo": "000000000000000000000035",
"type": 12,
"title": "背景飄雪 (3 天)",
"validDays": 3
}
]
}
Url: /pet/lastPurchaseTime
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
goodsNo |
String |
false |
物品id |
param |
type |
description |
success |
bool |
是否成功 |
data |
Object |
|
itemId |
string |
物品名称 |
title |
String |
|
timeStamp |
String |
购买时间 UTC |
request:
{
"goodsNo":"000000000000000000000032"
}
response:
{
"success": true,
"data": {
"itemId": "000000000000000000000032",
"title": "原木地板",
"timeStamp": "2017-11-29T06:07:49.490Z"
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
goodsNo |
String |
false |
物品id |
param |
type |
description |
success |
bool |
是否成功 |
data |
Object |
|
request:
{
"goodsNo":"000000000000000000000032"
}
response:
{
"success": true,
"data": {
"n": 1,
"nModified": 1,
"ok": 1
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
type |
number |
false |
类型 1(收入) 2 (支出) |
score |
number |
false |
分值 |
description |
string |
true |
描述信息 |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
_id |
String |
|
request:
{
"score":30,
"type":1,
"description":"use for gift"
}
response:
{
"success": true,
"data": {
"_id": "59ae0dbdc4f616960b1aa276"
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
income |
number |
收入 |
expenses |
number |
支出 |
balance |
number |
余额 |
request:
{
"score":30,
"type":1,
"description":"use for gift"
}
response:
{
"success": true,
"data": {
"income": 100,
"expenses": 60,
"balance": 40
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
array 内部object 字段含义同上传 |
request:
{
"score":30,
"type":1,
"description":"use for gift"
}
response:
{
"success": true,
"data": [
{
"_id": "59ae025fd5487ec70af574d5",
"timeStamp": "2017-09-05T01:48:15.336Z",
"score": 10,
"type": 1,
"description": "add from walk"
},
{
"_id": "59ae0268d5487ec70af574d6",
"timeStamp": "2017-09-05T01:48:24.499Z",
"score": 10,
"type": 1,
"description": "add from sleep"
}
]
}
Url: /healthCoin/getLotteryList
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
array |
array |
item.score |
number |
所需健康幣 |
item.title |
string |
|
item.description |
string |
|
request:
{
}
response:
{
"success": true,
"data": [
{
"_id": "59c4cbdbb920b7e00e537d71",
"timeStamp": "2017-09-22T08:37:47.478Z",
"score": 5,
"title": "7-11 500元员商品券 X名",
"description": "7-11 500元商品劵 X名"
},
{
"_id": "59c4cc85b920b7e00e537d72",
"timeStamp": "2017-09-22T08:40:37.625Z",
"score": 120,
"title": "Zenbo標準版+充電器 1名",
"description": "Zenbo標準版+充電器 1名"
},
{
"_id": "59c4ccc2b920b7e00e537d73",
"timeStamp": "2017-09-22T08:41:38.592Z",
"score": 200,
"title": "iPhone X 64G顏色隨機 1名",
"description": "iPhone X 64G顏色隨機 1名"
}
]
}
Url: /healthCoin/signLottery
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_id |
string |
false |
獎項id |
param |
type |
description |
success |
bool |
是否成功,如果餘額不足,錯誤碼1033, |
balance |
number |
成功返回賬號餘額 |
request:
{
"_id":"59c4cbdbb920b7e00e537d71"
}
response:
{
"success": true,
"balance": 11
}
Url: /healthCoin/checkSignedLottery
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_id |
string |
false |
獎項id |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
如果没有返回null,否则返回相关信息。 |
request:
{
"_id":"59c4cbdbb920b7e00e537d71"
}
response:
{
"success": true,
"data": {
"_id": "59cc900e044173820639fb1e",
"timeStamp": "2017-09-28T06:00:46.858Z",
"score": 5,
"description": "7-11 500元员商品券 X名"
}
}
Url: /healthCoin/buyPetGoods
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_id |
string |
false |
商品id |
param |
type |
description |
success |
bool |
是否成功,如果餘額不足,錯誤碼1033, |
balance |
number |
成功返回賬號餘額 |
request:
{
"_id":"59f1d100d368989c13fcb5de"
}
response:
{
"success": true,
"balance": 174
}
Url: /user/getMedicationReminder
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
_id |
String |
string |
items |
Array |
用药提醒内容, |
request:
{
}
response:
{
"success": true,
"data": {
"_id": "59b109d4bb0c6994e0d61e81",
"items": [
{
"order": 0,
"title": "一天一次(QD):每日9點提醒",
"enable": false,
"_id": "59b108fe45d55ab00be9ad98",
"reminderTime": [
9
]
},
{
"order": 1,
"title": "一天兩次(BID):每日9點,17點提醒",
"enable": false,
"_id": "59b108fe45d55ab00be9ad97",
"reminderTime": [
9,
17
]
},
{
"order": 2,
"title": "一天三次(TIDPC):每日9點,每日13點,18點提醒",
"enable": false,
"_id": "59b108fe45d55ab00be9ad96",
"reminderTime": [
9,
13,
17
]
}
]
}
}
Url: /user/updateMedicationReminder
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
_id |
String |
false |
id |
items |
Array |
false |
get时获取的items,更新时请设置 enable ,取值为 true/false |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
_id |
String |
|
request:
{
"_id": "59b109d4bb0c6994e0d61e81",
"items": [
{
"order": 0,
"title": "一天一次(QD):每日9點提醒",
"enable": false,
"_id": "59b108fe45d55ab00be9ad98",
"reminderTime": [
9
]
},
{
"order": 1,
"title": "一天兩次(BID):每日9點,17點提醒",
"enable": false,
"_id": "59b108fe45d55ab00be9ad97",
"reminderTime": [
9,
17
]
},
{
"order": 2,
"title": "一天三次(TIDPC):每日9點,每日13點,18點提醒",
"enable": false,
"_id": "59b108fe45d55ab00be9ad96",
"reminderTime": [
9,
13,
17
]
}
]
}
response:
{
"success": true,
"data": {
"n": 1,
"nModified": 1,
"ok": 1
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
_id |
String |
string |
type |
Number |
1 首页 2 底部 3 底部 |
source |
String |
广告商 |
keyId |
String |
广告识别ID |
request:
{
}
response:
{
"success": true,
"data": {
"_id": "000000000000000000000000",
"type": 1,
"source": "youtube",
"keyId": "v3O61vIN9Ks",
"moreLink": "https://www.youtube.com/channel/UCltLZ1l3dgPvs_INJf-770g",
"title": "新北勞工八月大腸癌免費檢查",
"content": "新北市轄內工商行號的勞工朋友不分男女、只要揪滿30人,就可與當地衛生所協調日期,派專業的醫護團隊前往公司免費進行大腸癌及口腔癌篩檢,守護勞工朋友的健康、守護勞工朋友的家庭",
"timeStamp": "2017-09-08T01:32:53.133Z",
"recordBy": null,
"isDeleted": false
}
}
Url: /activity/getMarqueeList
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
目标 |
request:
{
}
response:
{
"success": true,
"data": [
{
"title": "社區課程002",
"description": "動健康初級班,適合從未接觸過動健康的民眾。",
"_id": "59b74a1282e7db094ce74107"
},
{
"title": "專業**課程001",
"description": "動健康初級班,適合從未接觸過動健康的民眾。",
"_id": "59b74a1282e7db094ce74104"
},
{
"title": "社區**班01",
"description": "活動02",
"_id": "59b742d01dae2105208a3283"
},
{
"title": "大型活動一",
"description": "好吃好玩 der",
"_id": "59af7d2f042b6e0f107006be"
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
title |
String |
false |
名稱 |
type |
Number |
false |
類型 (1)萬步走 (2)** 30 分 (3) 三蔬 (4) 二果 (5)五蛋白 (6)八杯水 |
visible |
boolean |
false |
開放true 私有false |
description |
String |
true |
介紹 |
avatar |
String |
true |
圖標Url ,請先call upload 上傳圖像后獲取文件url 填入,可不填 |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
_id |
String |
string |
request:
{
"title":"干杯吧朋友",
"type":1,
"description":"每天八杯水,健康五十年",
"visible":true,
"avatar":"http://localhost:4001/v1/fitGroup/downloadphoto?filename=dfdd370c-912b-458a-a145-0e2ea8a96067"
}
response:
{
"success": true,
"data": {
"_id": "59e490e2e31bee270dbaa80e"
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
groupId |
string |
false |
群id |
title |
String |
true |
名稱 |
type |
Number |
true |
類型 (1)萬步走 (2)** 30 分 (3) 三蔬 (4) 二果 (5)五蛋白 (6)八杯水 |
visible |
boolean |
true |
開放true 私有false |
description |
String |
true |
介紹 |
avatar |
String |
true |
圖標Url ,請先call upload 上傳圖像后獲取文件url 填入,可不填 |
param |
type |
description |
success |
bool |
是否成功 |
data |
object |
目标 |
request:
{
"groupId":"59e47165a2ee860a0a9c49a7",
"title":"水果大比拼",
"type":2,
"description":"水果有营养",
"visible":true,
"avatar":"http://101.201.234.233/v1/fitGroup/downloadphoto?filename=dfdd370c-912b-458a-a145-0e2ea8a96067"
}
response:
{
"success": true,
"data": {
"n": 1,
"nModified": 1,
"ok": 1
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
files |
File |
false |
上傳採用的是 form-data 模式,具體參考食物上傳 |
param |
type |
description |
success |
bool |
是否成功 |
data |
Object |
|
request:
{
"types":[2]
}
response:
{
"success": true,
"fileUrl": "http://localhost:4001/v1/fitGroup/downloadphoto?filename=53bbd27c-8422-4baf-96c2-1648f9753b8f"
}
Url: /fitGroup/downloadphoto
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
filename |
string |
false |
返回的標識字串 |
param |
type |
description |
圖形數據 |
|
|
URL 格式:http://localhost:4001/v1/fitGroup/downloadphoto?filename=19a94389-63d2-43a8-bb72-b688a7d772fe
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
|
request:
{
}
response:
{
"success": true,
"data": [
{
"_id": "59e490e2e31bee270dbaa80e",
"title": "**大本營",
"type": 2,
"description": "每天**30分,健康五十年",
"avatar": "http://localhost:4001/v1/fitGroup/downloadphoto?filename=dfdd370c-912b-458a-a145-0e2ea8a96067",
"numberOfMember": 1,
"owner": true
}
]
}
Url: /fitGroup/listPending
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
|
item.owner: 是否是群主 , 与下面 2,3状态组合, 可以得出4种状态 |
|
|
item.member.state (1) 正常 (2) 邀请, (3) 申请 |
|
|
request:
{
}
response:
{
"success": true,
"data": [
{
"_id": "59e47165a2ee860a0a9c49a7",
"avatar": "http://101.201.234.233/v1/fitGroup/downloadphoto?filename=dfdd370c-912b-458a-a145-0e2ea8a96067",
"title": "吃水果大賽",
"member": {
"userNo": "59ddbbf33f398a155c9c5310",
"state": 3,
"name": "billwang",
"photo": "default.png"
},
"owner": true
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
types |
Array |
true |
不傳默認顯示所有群組,類型 (1)萬步走 (2)** 30 分 (3) 五蔬果 (4)八杯水 |
name |
String |
true |
群名 |
groupId |
String |
true |
群組ID |
keyword |
String |
true |
可为群名或者群组ID |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
|
request:
{
"types":[2]
}
response:
{
"success": true,
"data": [
{
"_id": "59e490e2e31bee270dbaa80e",
"title": "**大本營",
"type": 2,
"description": "每天**30分,健康五十年",
"avatar": "http://localhost:4001/v1/fitGroup/downloadphoto?filename=dfdd370c-912b-458a-a145-0e2ea8a96067",
"numberOfMember": 1,
}
]
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
groupId |
string |
false |
群id |
param |
type |
description |
success |
bool |
是否成功 |
data |
Object |
|
request:
{
"groupId":"59e47165a2ee860a0a9c49a7"
}
response:
{
"success": true,
"data": {
"_id": "59e891ae8143f22f13d66242",
"title": "跑步軍團-093-310",
"displayId": 10001,
"avatar": "http://localhost:4001/v1/group/downloadphoto?filename=dfdd370c-912b-458a-a145-0e2ea8a96067",
"members": [
{
"userNo": "59ddbbf33f398a155c9c5310",
"name": "billwang",
"photo": "default.png",
"isSelf": false
},
{
"userNo": "5982ec27587743070562bf8e",
"name": "billwang",
"photo": "5982ec27587743070562bf8e.png",
"isSelf": true
}
],
"owner": false
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
account |
string |
false |
用户账号或手机号 |
param |
type |
description |
success |
bool |
是否成功 |
data |
Object |
|
item._id |
String |
userNo |
item.photo |
String |
参考用户api 获取头像 |
request:
{
"types":[2]
}
response:
{
"success": true,
"data": {
"_id": "5982ec27587743070562bf8e",
"name": "billwang",
"photo": "default.png"
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
groupId |
string |
false |
群ID |
userNo |
string |
false |
用户ID |
param |
type |
description |
success |
bool |
是否成功 |
data |
Object |
|
request:
{
"groupId":"59e891ae8143f22f13d66242",
"userNo":"5982ec27587743070562bf8e"
}
response:
{
"success": true,
"data": {
"n": 1,
"nModified": 1,
"ok": 1
}
}
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
groupId |
string |
false |
群ID |
param |
type |
description |
success |
bool |
是否成功 |
data |
Object |
|
request:
{
"groupId":"59e891ae8143f22f13d66242",
}
response:
{
"success": true,
"data": {
"n": 1,
"nModified": 1,
"ok": 1
}
}
Url: /fitGroup/getTodaySportRank
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
groupId |
string |
false |
群id |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
返回本群的运动排名数组,如果数组为空,表示没有数据, |
item.isSelf |
boolean |
为true表示用户自己,没有为true的item表示用户无数据。 |
request:
{
"groupId":"59e891ae8143f22f13d66242"
}
response:
{
"success": true,
"data": [
{
"sportsTime": 60,
"userNo": "59ddbbf33f398a155c9c5310",
"name": "billwang",
"photo": "default.png",
"isSelf": false
},
{
"sportsTime": 30,
"userNo": "5982ec27587743070562bf8e",
"name": "billwang",
"photo": "5982ec27587743070562bf8e.png",
"isSelf": true
}
]
}
Url: /fitGroup/getTodayWalkRank
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
groupId |
string |
false |
群id |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
返回本群排名数组,如果数组为空,表示没有数据, |
item.isSelf |
boolean |
为true表示用户自己,没有为true的item表示用户无数据。 |
request:
{
"groupId":"59e891ae8143f22f13d66242"
}
response:
{
"success": true,
"data": [
{
"steps": 11400,
"userNo": "5982ec27587743070562bf8e",
"name": "billwang",
"photo": "5982ec27587743070562bf8e.png",
"isSelf": true
}
]
}
Url: /fitGroup/getTodayFoodRank
Header:
Headers |
type |
nullable |
description |
Authorization |
string |
false |
账号授权token, 格式 "Bearer " + token 字串 |
param |
type |
nullable |
description |
groupId |
string |
false |
群id |
type |
string |
false |
食物类别 蔬(1) 果(2) 蛋白(3) 水(4) |
param |
type |
description |
success |
bool |
是否成功 |
data |
Array |
返回本群排名数组,如果数组为空,表示没有数据, |
item.isSelf |
boolean |
为true表示用户自己,没有为true的item表示用户无数据。 |
item.finished |
boolean |
是否达标 |
item.value |
boolean |
食物份数 |
request:
{
"groupId":"59e891ae8143f22f13d66242",
"type" : 1
}
response:
{
"success": true,
"data": [
{
"value": 2,
"userNo": "5982ec27587743070562bf8e",
"name": "billwang092",
"photo": "5982ec27587743070562bf8e.png",
"finished": true,
"isSelf": true
},
{
"value": 1,
"userNo": "59ddbbf33f398a155c9c5310",
"name": "billwang093",
"photo": "59ddbbf33f398a155c9c5310.png",
"finished": false,
"isSelf": false
}
]
}