【转载】接口文档

字数 6108阅读 13

康保健康后台
标签(java后台): java

一、用户登陆相关
1,注册
[POST] rest/hUserController
body:

{
    "mobile":"17718577726",
    "passwordNew":"passwordNew",
    "passwordNew2":"passwordNew2",
    "source":"数据来源 ad ios"
}

result:
{"result":"注册成功","statusCode":"000000","error":""}

note:正确的返回形式,result返回数据,statusCode返回状态码(正确返回6个0,错误返回不一定,暂定6个6)

result(error):
{"result":"","statusCode":"666666","error":"数据异常"}
{"result":"","statusCode":"666666","error":"请填写手机号!"}
{"result":"","statusCode":"666666","error":"请输入密码!"}
{"result":"","statusCode":"666666","error":"请重复输入密码!"}
{"result":"","statusCode":"666666","error":"两次密码输入不一致,请重新输入!"}
{"result":"","statusCode":"666666","error":"注册异常,注册涞源为空!"}
{"result":"","statusCode":"666666","error":"手机号已被注册!"}

note:处理失败的返回形式,resut为“”,statusCode返回错误码,error显示错误信息(一般是异常信息)
以上都是返回200的情况下,非正常请求不包括在内(连接超时、断链等)

2,App登陆
[POST] rest/hUserController/login
body:

{
    "mobile":"17718577726",
    "password":"password"
}

result:
{
"result": {
"id": "ff8080815f291a71015f291aeb400000",
"token": "8b7761ab7af94092b10c51d87ae182ab"
},
"error": "",
"statusCode": "000000"
}

result(error):
{"result":"","statusCode":"666666","error":"数据异常"}
{"result":"","statusCode":"666666","error":"请输入手机号"}
{"result":"","statusCode":"666666","error":"请输入密码"}
{"result":"","statusCode":"666666","error":"账号或密码有误!"}

3,修改密码
[PUT] rest/hUserController/updateAppPassword/{id}
body:

{
    "token":"token",
    "password":"password",
    "passwordNew":"passwordNew",
    "passwordNew2":"passwordNew2",
}

result:
{"result":"OK","statusCode":"000000","error":""}

result(error):
{"result":"","statusCode":"666666","error":"token丢失"}
{"result":"","statusCode":"666666","error":"旧密码不能为空"}
{"result":"","statusCode":"666666","error":"新密码不能为空"}
{"result":"","statusCode":"666666","error":"重复新密码不能为空"}
{"result":"","statusCode":"666666","error":"新密码和重复新密码不一致"}
{"result":"","statusCode":"666666","error":"token不存在"}
{"result":"","statusCode":"666666","error":"旧密码错误"}

4,发送短信验证码
[post] rest/hSmsController/sendSms
body:{
"tel":"2134"
}

result:{
"result": "283293", //验证码
"error": "",
"statusCode": "000000"
}
}

5,修改手机号
[put] rest/hUserController/updateTel/{id}
body:{
"token":"token",
"mobile":"mobile"
},
result:{"result": "ok", "error": "","statusCode": "000000"}
}

6,忘记密码
[POST] rest/hUserController/forgot/{id}
body:

{
    "tel":"tel",
    "code":"code",
    "password":"passwordNew"
}

result:
{"result":"OK","statusCode":"000000","error":""}

7,注销
[post] rest/hUserController/logout
body:{
"id":"1234"
}
result:{
"result":"ok",
"statusCode":"000000",
"error":""
}

8,token获取用户id
[GET] rest/hUserController/getUserId/{token}
body:

result:
{"result":"32到36位userId","statusCode":"000000","error":""}

result(error):
{"result":"","statusCode":"666666","error":"token丢失"}
{"result":"","statusCode":"666666","error":"token不存在"}

9,微信注册
[post]rest/hUserController/wxCreate
body:{"wxopenid":"123"}
result:{"result":"注册成功!","statusCode":"000000","error":""}
error:{"result":"","statusCode":"666666","error":"该微信号已绑定"}

10,微信绑定app账号
[post] rest/hUserController/linkAppByWeixin/{wxopenid}
body:{
"mobile":"17718577726"
}
result:{"result":"OK","statusCode":"000000","error":""}
error:{"result":"","statusCode":"666666","error":"此微信号已绑定手机号,请解除绑定后重试!"}
error:{"result":"该手机号已绑定微信,请解绑或者换一个手机号","error":"","statusCode":"000000"}

11,手机号解绑微信
[delete] removeWeixin/{userid}/{token}
result:{"result":"OK","statusCode":"000000","error":""}

12,微信解绑手机号
[delete] removeMobile/{wxopenid}
result:{"result":"OK","statusCode":"000000","error":""}

13,微信号登陆用户
[get] rest/hUserController/weixin/{wxopenid}
result:{"result":{},"error":"","statusCode":"000000"}

二、用户信息
1,编辑用户信息
[PUT] rest/hUserController/update/{id}
body:

{
    "wxopenid":"",//微信端使用,app端不要传
    "token":"token",//app端使用
    "realname":"真实姓名",
    "nickname":"昵称",
    "documentType":"证件类型",  参考后端数据字典
    "idNo":"证件号码",
    "registered":"证件地址",
    "issuingAuthority":"发证机关",
    "term":"证件有效期限",
    "pictureAddress":"证件照片地址",
    "icCardNumber":"IC卡号",
    "icCardIdentifier":"IC卡识别符",
    "socialSeurityNumber":"社保号码",
    "dateOfBirth":"出生日期",
    "educationalLevel":"文化程度",
    "occupation":"职业",
    "sex":"性别",
    "nation":"民族",
    "bloodType":"血型",
    "rhBloodType":"RH阴性",
    "unitOfWork":"工作单位",
    "province":"所在省",
    "city":"所在市",
    "area":"所在区",
    "residence":"居住地址",
    "residence1":"投递地址1",
    "residence2":"投递地址2",
    "memberTag":"会员标签",
    "neighborhood":"村居委会",
    "neighborhoodTel":"村居委会电话",
    "emergencyContact":"紧急联系人",
    "emergencyContactTel":"紧急联系人电话",
    "cardNumber":"会员卡号",
    "medicalReport":"体检报告",
    "healthReport":"健康报告",
    "patientRecord":"就医记录",
    "prescription":"用药记录"
    
}

result:
{"result":"OK","statusCode":"000000","error":""}

result(error):
{"result":"","statusCode":"666666","error":"token丢失"}
{"result":"","statusCode":"666666","error":"数据异常"}

2,查询用户信息
[GET] rest/hUserController/{id}
result: {"result":"JSON对象","statusCode":"000000","error":""}
error: {"result":"","statusCode":"666666","error":"token丢失"}

3,上传用户头像
三、我的家人
1,查看我的家人
[GET] rest/hUserController/familyList/{userId}
result:
{
"result": [
{
"id": "12312312312312321",
"user_id": "ff8080815f291a71015f291aeb400000",
"name": "李四",
"tel": "1727272727",
"releationship": "4",
"shipcontent": "兄弟姐妹"
}
],
"statusCode": "000000",
"error": ""
}

2,编辑我的家人
[PUT] rest/hUserController/updateFamilyInfo/{familyidid}
body:

{
    "wxopenid":"",//微信端使用app不要传
    "token":"token",//app端使用
    "name":"家人姓名",
    "tel":"家人电话",
    "releationship":"关系"
}

result:
{"result":"OK","statusCode":"000000","error":""}

3,添加我的家人
[post] rest/hUserController/addFamilyInfo
body:

{
    "wxopenid":"",//微信id,微信端使用
    "token":"",//app端使用
    "userId":"会员id",
    "name":"家人姓名",
    "tel":"家人电话",
    "releationship":"关系"
}

result:
{"result":"OK","statusCode":"000000","error":""}

4,删除我的家人(app)
[delete] rest/hUserController/deleteFamily/{familyid}/{token}
result: {"result":"OK","statusCode":"000000","error":""}

5,删除我的家人(wx)
[delete] rest/hUserController/deleteFamilywx/{familyid}/{wxopenid}
result: {"result":"OK","statusCode":"000000","error":""}

四、我的地址
1,添加我的地址
[post] rest/hUserAddressController
body:{
"token":"",//app使用
"wxopenid":"",//微信端使用
"userid":"",//管联的用户id
"name":"",//收货人
"tel":"",//电话
"code":"",//邮编
"province":"",//所在省
"city":"",//所在市
"area":"",//所在区
"address":"",//详细地址
"isdefault":"" //是否默认地址,是:1,否:0,默认为0
}
result:{"result":"ok","statusCode":"000000","error":""}

2,编辑我的地址
[put] rest/hUserAddressController/{addressid}
body:{
"token":"",
"wxopenid":"",
"name":"",//收货人
"tel":"",//电话
"code":"",//邮编
"province":"",//所在省
"city":"",//所在市
"area":"",//所在区
"address":"",//详细地址
"isdefault":"" //是否默认地址,是:1,否:0,默认为0
}

3,查看我的地址
[get] rest/hUserAddressController/{addressid}
result:{
"address": "啊啊啊",
"name": "张1三",
"id": "ff8080815f32bc5a015f32bf77b00000",
"code": "2132323",
"createName": null,
"createBy": null,
"area": "朝阳",
"city": "北京",
"tel": "15411343242",
"province": "北京",
"userid": "ff8080815f291a71015f291aeb400000",
"isdefault": "1"
}

4,删除地址(app)
[delete] rest/hUserAddressController/{addressid}/{token}
result:{"result":"ok","statusCode":"000000","error":""}

error:{"result":"","statusCode":"666666","error":"该地址不存在BY THIS ADDRESSID"}

5,删除地址(wx)
[delete] rest/hUserAddressController/removeWx/{addressid}/{wxopenid}
result:{"result":"ok","statusCode":"000000","error":""}

error:{"result":"","statusCode":"666666","error":"该地址不存在BY THIS WXOPENID"}

6,通过用户id查看地址列表
[get] rest/hUserAddressController/list/{userid}
result:{
"result": [
{
"address": "啊啊啊",
"name": "张三",
"id": "ff8080815f32bc5a015f32c1e4420001",
"area": "朝阳",
"code": "2132323",
"userid": "ff8080815f291a71015f291aeb400000",
"createName": null,
"createBy": null,
"isdefault": "1",
"province": "北京",
"city": "北京",
"tel": "15411343242"
}
],
"error": "",
"statusCode": "000000"
}

五、资讯信息
1,查看资讯信息
[get] rest/hInformationController/{informationid}
result:{
"result": {
"id": "ff8080815f33f4b4015f33f5b7740002",
"content": "1232",
"status": "1",
"imageUrl": null,
"title": "今天天气不错",
"createtime": 1508491654000
},
"error": "",
"statusCode": "000000"
}
error:{"result":"","error":"数据不存在BY THIS ID","statusCode":"666666"}

2,查看资讯列表(带分页)
[post] rest/hInformationController/get
body:{
"title":"",
"status":"",
"startindex":0,
"pagesize":10,
"begincreatetime":"2017-01-01 12:01:21" ,
"endcreatetime":"2017-01-01 12:01:21"
}

result:{
"result": [
{
"id": "ff8080815f3398b8015f33a04c430001",
"content": "mml;ml;mlml",
"status": "1",
"title": "aaa",
"imageUrl": "upload/files/20171019155424iOpgz8HB.jpg",
"createtime": 1510127260000
}
],
"error": "",
"statusCode": "000000"
}

六、硬件设备
1,绑定设备
[post] rest/appHardwareController
body:{
"token":"",
"name":"",//设备名称
"uniquecode":"123",//设备码(唯一标识)
"boundtype":"bluetooth", //绑定类型:蓝牙(bluetooth) ,暂时只有蓝牙,待添加
"source":"",//来源(android,ios,wx)
"userid":"12q13",//绑定的用户id
}
result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f398765015f3987ff040000",
"source": "ios",
"createDate": 1508498734844,
"uniquecode": "abcdefghijklmn1",
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth"
},
"statusCode": "000000",
"error": ""
}

error:{"result":"","statusCode":"666666","error":"该设备以绑定,绑定用户ID为:ff8080815f291a71015f291aeb400000"}

2,通过绑定的id解绑设备
[delete] rest/appHardwareController/{id}/{token}
result:{"result":"ok","statusCode":"000000","error":""}

3,通过设备码和用户id解绑设备
[post] rest/appHardwareController/unbound
body:{
"userid":"123",
"uniquecode":"qq123" ,
"token":""
}
result:{"result":"ok","statusCode":"000000","error":""}

3,查看设备
[get] rest/appHardwareController/{id}
result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f398765015f3987ff040000",
"source": "ios",
"createDate": 1508498734844,
"uniquecode": "abcdefghijklmn1",
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth"
},
"statusCode": "000000",
"error": ""
}

4,通过用户id查看设备列表
[get] rest/appHardwareController/query/{userid}
result:{"result":[],"error":"","statusCode":"000000"}

七、血压测量
1,录入数据
[post] rest/hBloodpressureController
body:{
"userid":"",//用户id
"token":"",
"bp_sys":"",//收缩压
"bp_dia":"",//舒张压
"bp_pulse":"",//脉搏
"source":"",//数据来源(ios,android,wx)
"boundtype":"",//绑定类型,暂时只有bluetooth
"name":"",//设备名称
}

result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f39b9ca015f39bfa8100000",
"source": "ios",
"createDate": null,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth",
"bpSys": "1",
"bpDia": "2",
"bpPulse": "3"
},
"statusCode": "000000",
"error": ""
}

2,查看一条数据
[get] rest/hBloodpressureController/{id}
result:{"result":{},"error":"","statusCode":"000000"}

3,通过用户ID查看测量数据
[post] rest/hBloodpressureController/get
body:{
"userid":"",//用户id
"startindex":"",//起始下标,分页用
"pagesize":"",//每页条数
"begincreatetime":"2017-01-01 12:01:21" ,
"endcreatetime":"2017-01-01 12:01:21"
}

result:{"result":[{}],"statusCode":"000000","error":""}

4,通过数据ID删除数据
[delete] rest/hBloodpressureController/{id}
result:{"result":"ok","error":"","statusCode":"000000"}

5,统计信息
[get] rest/hBloodpressureController/count/{userid}/{field}/{starttime}/{endtime}
//{用户id,字段:(),开始时间(yyyy-MM-dd) 结束时间(yyyy-MM-dd)}
field:{bp_sys|bp_dia|bp_pulse}
result:{
"result": [
{
"date": "2017-10-20",
"field": "bp_sys",
"max": "5",
"min": "1",
"avg": 3
},
{
"date": "2017-10-31",
"field": "bp_sys",
"max": "1",
"min": "1",
"avg": 1
}
],
"error": "",
"statusCode": "000000"
}

6,查看时间范围内指定指标最大的血压数据
[post] rest/hBloodpressureController/max
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"field":"",//{bp_sys , bp_dia , bp_pulse}
"userid":""
}
result:{
"result": [
{
"name": "apple watch 38mm",
"id": "ff8080815f39b9ca015f39bfa8100000",
"bpSys": "1",
"bpDia": "2",
"bpPulse": "3",
"source": "ios",
"createDate": 1508503056000,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth"
}
],
"error": "",
"statusCode": "000000"
}

7,查看时间范围内指定指标最小的血压数据
[post] rest/hBloodpressureController/min
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"field":"",//{bp_sys , bp_dia , bp_pulse}
"userid":""
}
result:{"result":[],"error":"","statusCode":"000000"}

八、血氧
1,添加测量数据'
[post] rest/hBloodoxygenController
body:{
"userid":"ff8080815f291a71015f291aeb400000",
"token":"8b7761ab7af94092b10c51d87ae182ab",
"bo_xy":"1",
"bo_mb":"2",
"source":"ios",
"boundtype":"bluetooth",
"name":"apple watch 38mm"
}

result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f3d9dab015f3d9e5ab00000",
"source": "ios",
"createDate": 1508567308967,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth",
"boXy": "1",
"boMb": "2"
},
"error": "",
"statusCode": "000000"
}

2,通过数据ID查看数据
[get] rest/ hBloodoxygenController/{id}
result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f3d9dab015f3d9e5ab00000",
"source": "ios",
"createDate": 1508567308967,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth",
"boXy": "1",
"boMb": "2"
},
"error": "",
"statusCode": "000000"
}

3,通过用户ID查看数据
[post] rest/hBloodoxygenController/get
body:{
"userid":"" ,
"startindex":"10",
"pagesize":"3",
"begincreatetime":"2016-12-12 00:00:00",
"endcreatetime":"2018-12-13 00:00:00"
}
result:{"result":[],"error":"","statusCode":"000000"}

4,统计信息
[get] rest/hBloodoxygenController/count/{userid}/{field}/{starttime}/{endtime}
//{用户id,字段:(),开始时间(yyyy-MM-dd) 结束时间(yyyy-MM-dd)}
field:{bo_xy|bo_mb}
result:{
"result": [
{
"date": "2017-10-21",
"field": "bo_xy",
"max": "1",
"min": "1",
"avg": 1
},
{
"date": "2017-10-26",
"field": "bo_xy",
"max": "10",
"min": "10",
"avg": 10
}
],
"statusCode": "000000",
"error": ""
}

5,查看时间范围内指定指标最大的血氧数据
[post] rest/hBloodoxygenController/max
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"field":"",//{bo_xy , bo_mb}
"userid":""
}
result:{
"result": [
{
"name": "apple watch 38mm",
"id": "ff8080815f3d9dab015f3d9e5ab00000",
"createDate": 1508567309000,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth",
"source": "ios",
"boXy": "1",
"boMb": "2"
}
],
"statusCode": "000000",
"error": ""
}

6,查看时间范围内指定指标最小的血氧数据
[post] rest/hBloodoxygenController/min
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"field":"",//{bo_xy , bo_mb}
"userid":""
}
result:{"result":[],"error":"","statusCode":"000000"}

九、耳温
1,添加测量数据
[post] rest/hEartemperatureController
body:{
"userid":"applewatch 38mm",
"token":"45",
"eartemp_temp":"12",
"source":"ios",
"boundtype":"bluetooth",
"name":"apple watch 38mm"
}
result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f3dad23015f3daf4ea80003",
"source": "ios",
"createDate": 1508568420000,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth",
"eartempTemp": "1"
},
"error": "",
"statusCode": "000000"
}

2,通过数据ID查看数据
[get] rest/hEartemperatureController/{id}
result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f3dad23015f3daf4ea80003",
"source": "ios",
"createDate": 1508568420000,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth",
"eartempTemp": "1"
},
"error": "",
"statusCode": "000000"
}

3,通过用户ID查看数据
[post] rest/hEartemperatureController/get
body:{
"userid":"" ,
"startindex":"10",
"pagesize":"3",
"begincreatetime":"2016-12-12 00:00:00",
"endcreatetime":"2018-12-13 00:00:00"
}
result:{"result":[],"error":"","statusCode":"000000"}

4,统计信息
[get] rest/hEartemperatureController/count/{userid}/{starttime}/{endtime}
//{用户id,字段:(),开始时间(yyyy-MM-dd) 结束时间(yyyy-MM-dd)}
result:{
"result": [
{
"date": "2017-10-21",
"field": "eartemp_temp",
"max": "3",
"min": "1",
"avg": "1.67"
}
],
"error": "",
"statusCode": "000000"
}

5,查看时间范围内指定指标最大的耳温数据
[post] rest/hEartemperatureController/max
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"userid":""
}
result:{
"result": [
{
"name": "apple watch 38mm",
"id": "ff8080815f3dad23015f3daf40c10002",
"source": "ios",
"eartempTemp": "3",
"createDate": 1508568416000,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth"
}
],
"error": "",
"statusCode": "000000"
}

6,查看时间范围内指定指标最小的耳温数据
[post] rest/hEartemperatureController/min
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"userid":""
}
result:{"result":[],"error":"","statusCode":"000000"}

十、体重体脂
1,添加测量数据
[post] rest/hWeightBodyfatController
body:{
"userid":"ff8080815f291a71015f291aeb400000",
"token":"8b7761ab7af94092b10c51d87ae182ab",
"body_weight":"1",//体重
"body_fat_ratio":"2",//脂肪率
"body_muscle_mass":"3",//肌肉含量
"body_moisture":"1",//身体水分
"body_bmi":"2",//身体质量指数
"body_bmr":"3",//基础代谢率
"body_bone_mass":"4",//骨量
"body_visceral_fat":"5",//内脏脂肪
"source":"ios",
"boundtype":"bluetooth",
"name":"apple watch 38mm"
}
result:{
"result": {
"name": "apple watch 38mm",
"id": "ff8080815f3dbda4015f3dc0cc620000",
"createDate": 1508569566295,
"userid": "ff8080815f291a71015f291aeb400000",
"boundtype": "bluetooth",
"bodyWeight": "1",
"bodyFatRatio": "2",
"bodyMuscleMass": "3",
"bodyMoisture": "1",
"bodyBmi": "2",
"bodyBmr": "3",
"bodyBoneMass": "4",
"bodyVisceralFat": "5",
"source": "ios"
},
"error": "",
"statusCode": "000000"
}

2,通过数据ID查看数据
[get] rest/hWeightBodyfatController/{id}
result:{"result":{},"error":"","statusCode":"000000"}

3,通过用户ID查看数据
[post] rest/hWeightBodyfatController/get
body:{
"userid":"" ,
"startindex":"10",
"pagesize":"3",
"begincreatetime":"2016-12-12 00:00:00",
"endcreatetime":"2018-12-13 00:00:00"
}
result:{"result":[],"error":"","statusCode":"000000"}

4,统计信息
[get] rest/hWeightBodyfatController/count/{userid}/{field}/{starttime}/{endtime}
//{用户id,字段:(),开始时间(yyyy-MM-dd) 结束时间(yyyy-MM-dd)}
*field:{"body_weight|body_fat_ratio|body_muscle_mass|body_moisture|body_bmi|
body_bmr|body_bone_mass|body_visceral_fat"};
result:{
"result": [
{
"date": "2017-10-21",
"field": "body_fat_ratio",
"max": "2",
"min": "2",
"avg": "2.00"
}
],
"error": "",
"statusCode": "000000"
}

5,查看时间范围内指定指标最大的体重体脂数据
[post] rest/hWeightBodyfatController/max
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"field":""
//{body_weight|body_fat_ratio|body_muscle_mass|body_moisture|
//body_bmi|body_bmr|body_bone_mass|body_visceral_fat}
"userid":""
}
result:{
"result": [],
"error": "",
"statusCode": "000000"
}

6,查看时间范围内指定指标最小的体重体脂数据
[post] rest/hWeightBodyfatController/min
body:{
"time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
"field":""
//{body_weight|body_fat_ratio|body_muscle_mass|body_moisture|
//body_bmi|body_bmr|body_bone_mass|body_visceral_fat}
"userid":""
}
result:{
"result": [],
"error": "",
"statusCode": "000000"
}

十一、直播相关
1,直播号注册
[post] rest/WebCast/register
body:{
"token": "",
"name": "张宁",
"icon": "这是头像路径地址",
"sign": "这是一条签名",
"email": "邮箱",
"birth": "2017-01-01",
"mobile": "15311494814",
"gender": "0",
"userid": ""
}

result:{
"result": {
"code": 200,
"info": {
"name": "张宁",
"accid": "cdb343ad3c724d3889169d211a16fe55",
"token": "e9fe9bd1d1b378e66efd1d8c576b19f6"
}
},
"error": "",
"statusCode": "000000"
}

error:{
"result": "",
"error": "{"code":414,"desc":"already register"}",
"statusCode": "666666"
}

2,更新用户直播云信息
[post] rest/WebCast/update
body:{
"token": "",
"name": "张宁",
"icon": "这是头像路径地址",
"sign": "这是一条签名",
"email": "邮箱",
"birth": "2017-01-01",
"mobile": "15311494814",
"gender": "0",
"accid": ""
}

result:{
"result": {
"code": 200
},
"error": "",
"statusCode": "000000"
}

3,通过userid或者accid查看直播个人信息
[post] rest/WebCast/getInfo
body: {
"userid":"",
"accid":""//注:userid和accid可以同时搜索,也可以单独搜索
}

result:{
"result": {},
"error": "",
"statusCode": "000000"
}

4,通过accid创建聊天室
[post] rest/WebCast/createChartRoom
body:{
"accid":"",//必填
"name":"",//直播间地址,必填
"announcement":""//公告,
"broadcasturl":""//直播地址,非必填
}

result:{
"result": {
"code": 200,
"chatroom": {
"valid": true,
"broadcasturl": " ",
"ext": "",
"creator": "cdb343ad3c724d3889169d211a16fe55",
"name": "张宁的聊天室2",
"muted": false,
"roomid": 18157129,
"announcement": "1231231231"
}
},
"statusCode": "000000",
"error": ""
}

3,通过accid创建直播频道
[post] rest/WebCast/createLiveChannel
body:{
"name":"",//直播频道名称
"type":0,//频道类型默认为0(rtmp)
}

result:{
"result": {
"ret": {
"httpPullUrl": "http://flvb7a6bebe.live.126.net/live/fc289c13a4b545bd9654d6c729a158c4.flv?netease=flvb7a6bebe.live.126.net",
"hlsPullUrl": "http://pullhlsb7a6bebe.live.126.net/live/fc289c13a4b545bd9654d6c729a158c4/playlist.m3u8",
"pushUrl": "rtmp://pb7a6bebe.live.126.net/live/fc289c13a4b545bd9654d6c729a158c4?wsSecret=09a18e1cb66fac4afb5d3392951c0c39&wsTime=1508680138",
"rtmpPullUrl": "rtmp://vb7a6bebe.live.126.net/live/fc289c13a4b545bd9654d6c729a158c4",
"name": "张宁直播间1",
"ctime": 1508680138831,
"cid": "fc289c13a4b545bd9654d6c729a158c4"
},
"code": 200,
"requestId": "live1a51464ff7334d90b92b52b517164ade"
},
"statusCode": "000000",
"error": ""
}
error:{
"result": {
"msg": "频道名称已经存在",
"code": 611,
"requestId": "live1a3d4def0e47424fa9417940f5b78262"
},
"statusCode": "000000",
"error": ""
}

4,获取直播频道列表
[post] rest/getLiveChannels
body:{
"startindex":"0",
"pagesize":"10",
"order":"asc"//升序asc降序desc
}
result:{"result":"{"ret":{"pnum":1,"totalRecords":4,"records":1,"list":[{"duration":120,"uid":77188,"filename":"张宁直播间1","recordStatus":null,"needRecord":0,"name":"张宁直播间1","format":1,"ctime":1508680138831,"type":0,"status":0,"cid":"fc289c13a4b545bd9654d6c729a158c4"}],"totalPnum":4},"code":200,"requestId":"live5f9452b71a944fac95b0a63e7e029a2d"}","error":"","statusCode":"000000"}

5,关联直播频道和聊天室
[post] rest/WebCast/linkChatAndLive
body:{
"cid": "0",
"roomid": "1",
"name": "zn",
"pushUrl": "",
"httpPullUrl": "",
"hlsPullUrl": "",
"rtmpPullUrl": ""
}

result:{
"result": {
"name": "zn",
"id": "ff8080815f4c59bb015f4c5badb70000",
"createDate": 1508814597551,
"cid": "0",
"pushUrl": null,
"httpPullUrll": null,
"hlsPullUrl": null,
"rtmpPullUrl": null,
"roomid": "1"
},
"statusCode": "000000",
"error": ""
}
error:{
"result": "",
"statusCode": "666666",
"error": "数据已存在BY THIS CID"
}

6,修改直播频道和聊天室关联
[put] rest/WebCase/updateChatAndLive/{cid}
body:{
"roomid":"1",
"name":"zn",
"pushUrl":"123",
"httpPullUrl":"",
"hlsPullUrl":"",
"rtmpPullUrl":""
}

result:{
"result": "ok",
"statusCode": "000000",
"error": ""
}
error:{
"result": "",
"statusCode": "666666",
"error": "数据不存在BY THIS CID"
}

7,删除聊天室和直播频道关系
[delete] rest/WebCast/deleteChatAndLive/{cid}
result:{
"result": "ok",
"statusCode": "000000",
"error": ""
}

8,查询聊天室和直播频道关系
[get] rest/WebCast/getChatAndLive/{cid}
result:{
"result": {
"name": "zn",
"id": "ff8080815f4c59bb015f4c5badb70000",
"createDate": 1508814598000,
"cid": "0",
"pushUrl": "123",
"httpPullUrll": "1213a",
"hlsPullUrl": "123b",
"rtmpPullUrl": "123c",
"roomid": "12"
},
"statusCode": "000000",
"error": ""
}

9,获取文件视频信息
[get] rest/WebCast/videoGet/{videoid}
result:{
"result": "{}",
"error": "",
"statusCode": "000000"
}

10,获取文件视频信息列表
[post] rest/WebCast/videoGets
body:{
"startindex":"0",
"pagesize":"1",
"type":"0",
"status":"10"
}
result:{"result":"{"ret":{"totalRecords":4,"pageSize":1,
"list":[{"downloadOrigUrl":"http://vodiwsmcsoe.nosdn.127.net/432a71c2-7a81-4caa-85f9-16137d3c409d.mp4?download=1111111111111111111111111111111.mp4",
"initialSize":354953,"typeName":"默认分类",
"description":"","completeTime":null,
"updateTime":1508815201299,"duration":2,"vid":29959806,
"createTime":1508814977576,"videoName":"1111111111111111111111111111111",
"snapshotUrl":"http://vodiwsmcsoe.nosdn.127.net/432a71c2-7a81-4caa-85f9-16137d3c409d/ea1d4dba-bb58-41ae-9a60-569a68aceef8",
"durationMsec":2338,"typeId":126513,
"origUrl":"http://vodiwsmcsoe.vod.126.net/vodiwsmcsoe/432a71c2-7a81-4caa-85f9-16137d3c409d.mp4",
"status":40}],
"currentPage":1,"pageNum":4},"code":200,"requestId":"4f39d249-5489-478b-a241-00441309d2ba"}","error":"","statusCode":"000000"}

11,根据roomid删除im聊天室
[delete] rest/WebCast/removeChatRoom/{roomid}
result:{"result":"{"code":200,"desc":{}}","error":"","statusCode":"000000"}
error:{"result":"{"code":414,"desc":"parameter roomid no exist or invalid, roomid=123"}","error":"","statusCode":"000000"}

12,设置频道的录制状态
[post] rest/WebCast/statusChannelTranscript
body:{
"cid":"0",//频道ID,32位字符串
"needRecord":1,//1-开启录制; 0-关闭录制
"format":"0",//1-flv; 0-mp4
"duration":"5",//录制切片时长(分钟),5~120分钟
"filename":""//非必填,录制后文件名(只支持中文、字母和数字),格式为filename_YYYYMMDD-HHmmssYYYYMMDD-HHmmss, 文件名录制起始时间(年月日时分秒) -录制结束时间(年月日时分秒)
}
result:{"result":"{"code":200,"requestId":"livef28dfa7c3efc4391a87b89da30ac94dc"}","error":"","statusCode":"000000"}

13,通过频道id获取录制的视频文件
[post] rest/WebCast/getVideoRecordsList
body:{
"cid":"b09839e9907e4b84a53c953ca4b7486d",//频道id,必填
"startindex":"",//.非必填默认为0
"pagesize":"10"//非必填默认为10
}
result:{"result":
"{"ret":{"pnum":1,"totalRecords":0,"records":10,"videoList":[],
"totalPnum":0},"code":200,"requestId":"live501d24c1ea1b47409ac28d261fc6ea22"}",
"error":"","statusCode":"000000"}

14,关联userid和cid
[post] rest/WebCast/linkUC
body:{
"cid":"abc", //频道id,必填
"userid":"123", //userid,必填
"ctime":"", //创建频道的时间戳
"name":"",//频道名称
"status":"",//频道状态(0:空闲; 1:直播; 2:禁用; 3:直播录制)
"type":"",//频道类型 ( 0 : rtmp, 1 : hls, 2 : http)
"needRecord":"",//1-开启录制; 0-关闭录制
"format":"",//1-flv; 0-mp4
"duration":"",//录制切片时长(分钟)
"filename":"",//录制后文件名
"msg":""//错误信息
}
result:{
"result": {
"name": "",
"id": "ff8080815f9f4e04015f9f4e7de20000",
"type": "",
"filename": "",
"status": "",
"duration": "",
"format": "",
"cid": "abc",
"createDate": 1510206242252,
"userid": "123",
"ctime": "",
"needRecord": "",
"msg": ""
},
"statusCode": "000000",
"error": ""
}
error:{"result":"","statusCode":"666666","error":"该cid已绑定用户"}

15,查看userid和cid(通过userid获取cid(频道号)的接口)
[post] rest/WebCast/getUC
body:{
"cid":"abc",//注:两者可以传一个,也可以都传
"userid":"123"
}
result:{ //注:虽然按cid查询或者cid和userid查询只会查询到一条,但是返回结果永远是[]
"result": [
{
"id": "ff8080815f9f5848015f9f61011f0000",
"create_date": 1510207455000,
"cid": "abc",
"userid": "123",
"ctime": "",
"name": "haha",
"status": "1",
"type": "2",
"need_record": "3",
"format": "4",
"duration": "5",
"filename": "6",
"msg": "error"
}
],
"statusCode": "000000",
"error": ""
}

16,修改关联信息
[put] rest/WebCast/modifyUC/{userid}/{cid}
body:{ //至少修改一个参数
"name":"haha",
"status":"1",
"type":"2",
"needRecord":"3",
"format":"4",
"duration":"5",
"filename":"6",
"msg":"error"
}
result:{"result":"ok","statusCode":"000000","error":""}

16,通过cid删除关联(该接口会清除指定频道)
[delete] rest/WebCast/removeUC/{cid}
result:{"result":"ok","statusCode":"000000","error":""}
error:{"result":"","statusCode":"666666","error":"该关联数据不存在 by this cid"}

17,清除用户所有频道(该接口会清除用户下所有频道)
[delete] rest/WebCast/removeUCAll/{userid}
result:{"result":"ok","statusCode":"000000","error":""}

十二、省市区联动

参数:pid
参数值为:1,返回的为所有的省
参数值为:其他pid值,返回的为:市或者县的数据

[get] jeecgFormDemoController.do?regionSelect&pid=1

返回结果:
[
{
"id": "13",
"name": "安徽省",
"pid": "1"
},
{
"id": "2",
"name": "北京市",
"pid": "1"
},
{
"id": "23",
"name": "重庆市",
"pid": "1"
},
{
"id": "14",
"name": "福建省",
"pid": "1"
}
]

十三、血糖仪接口
1,查询血糖仪数据列表(分页)
[POST] http://127.0.0.1/healthCare/rest/hBloodSugarController/list
body :{
"status":"100",//100:正常,99:推送成功,0:推送失败",
"devicesn":"设备SN码",
"foodstatus":"1",//测量状态, 1:空腹 2:早餐后 3:午餐前 4:午餐后 5:晚餐前 6:晚餐后 7:睡前 8:凌晨
"result":"检测结果值", // 血糖检测结果值 60
"userId":"会员id",
"page":2, //当前页
"rows":20//每页条数
}

返回结果: {
"result": [
{
"id": "40289ff25f435b5e015f435beb3a0000",
"result": "",
"page": 1,
"status": null,
"code": "",
"createdateBegin": null,
"rows": 10,
"createdateEnd": null,
"sysCompanyCode": null,
"createName": null,
"userId": null,
"sysOrgCode": null,
"createBy": null,
"updateName": null,
"updateDate": null,
"updateBy": null,
"aimstatus": "",
"devicesn": "",
"foodstatus": "",
"testtime": "",
"unit": "",
"usercode": "",
"createtime": "",
"openid": ""
},
{
..........................
},

],
"error": "",
"statusCode": "000000"

}

2,查询血糖仪数据(获取最新一条数据)
[POST] http://127.0.0.1/healthCare/rest/hBloodSugarController/getEntityByDevicesn
body :{ "userId":"用户id" }
返回结果:{
"result": {
"id": "402881475f47fe24015f47fed75a0000",
"result": "7",
"time": null,
"status": "100",
"code": "31215087291631",
"page": 1,
"updateBy": null,
"sysOrgCode": null,
"createBy": null,
"updateName": null,
"createName": null,
"updateDate": null,
"userId": "402881035ebd51e0015ebd5353590001",
"sysCompanyCode": null,
"openid": "",
"aimstatus": "5",
"devicesn": "2AH4MHR0886",
"usercode": "100114",
"testtime": "2017-10-25 11:25:25",
"unit": "0",
"createtime": "2017-10-25 11:26:03",
"foodstatus": "8",
"realname": null,
"rows": 10,
"createdateBegin": null,
"createdateEnd": null
},
"statusCode": "000000",
"error": ""
}

3,血糖仪统计接口
[POST] http://127.0.0.1/healthCare/rest/hBloodSugarController/getStatisticsBloodSugarData
body :{
"userId": "402881035ebd51e0015ebd5353590001",
"createdateBegin": "2017-10-01",
"createdateEnd": "2017-10-07"
}

返回结果: {
"result": [
{
"result_sum": "156.61",
"result_avg": "6.53",
"result_amax": "9.29",
"result_min": "5.29",
"testtime": "2017-10-23"
},
{
"result_sum": "7.00",
"result_avg": "7.00",
"result_amax": "7",
"result_min": "7",
"testtime": "2017-10-25"
}
],
"statusCode": "000000",
"error": ""
}

4,血糖-添加
[POST] rest/hBloodSugarController
body :
{
"userId":"123",
"devicesn":"设备id",
"foodstatus":"饭前饭后状态"
"result":"测试结果值",
"testtime":"测试时间",
"token":"token"
}

返回结果:
{"result":"OK","error":"","statusCode":"000000"}

返回异常:
{"result":"","statusCode":"666666","error":"token 丢失"}
{"result":"","statusCode":"666666","error":"token 不存在"}
{"result":"","statusCode":"666666","error":"未知异常"}

十四、惠健康手表接口:
1, 查询手表数据列表(分页)
[POST] http://127.0.0.1/healthCare/rest/watchController/list
body :{
"status": "100",//100:正常,99:推送成功,0:推送失败
"deviceid": "设备id",
"userId": "会员id",
"createdateBegin": "开始时间",
"createdateEnd": "结束时间",
"type": "类型",//1: 心率超标;2: sos报警;3: 电量过低;4: 跌倒报警;5: 服务电话呼叫;6: 血压超标;7: 充电器拔出;8: 久坐提醒;9: 充电器连接;10: 血糖超标11: 设备已开机12: 血氧超标13: 手表已经摘除22: 普通电话呼叫
"testType": "测试类型",//摔倒报警、sos报警、血压、心率、计步器、睡眠、血氧
"page": 2,//当前页
"rows": 20//每页条数
}
返回结果: {
"result": [
{
"id": "402881ec5f38e48d015f38e8523e0000",
"type": null,
"action": "sensor",
"reserve2": null,
"reserve3": null,
"devicename": null,
"longitude": null,
"sportstep": null,
"sportdistance": null,
"sportcalorie": null,
"sleeptotal": null,
"sleeplow": null,
"lbsinfo": null,
"latitude": null,
"sporttime": null,
"reserve1": null,
"sleepdeep": null,
"reserve5": null,
"reserve4": null,
"status": "100",
"page": 1,
"sysCompanyCode": null,
"rows": 10,
"createdateEnd": null,
"heart": "101",
"systolic": null,
"diastolic": null,
"heartrate": null,
"ox": null,
"deviceid": "626111000053511",
"createdateBegin": null,
"createDate": null,
"userId": null,
"updateBy": null,
"createName": null,
"createBy": null,
"sysOrgCode": null,
"updateName": null,
"testType": "血压",
"updateDate": null
},
{
...............
}
],
"statusCode": "000000",
"error": ""
}

2, 查询手表数据(获取最新一条数据)

[POST] http://127.0.0.1/healthCare/rest/watchController/getEntityByDeviceid 
body :{
    "userId": "用户id",
    "testType": "sos报警"//测试类型参数testType: 【sos报警/摔倒报警/血压/心率/计步器/睡眠/血氧】
}
返回结果:{
    "result": {
        "id": "402881ec5f38e48d015f38e8523e0000",
        "type": null,
        "statustime": "100"null,
        "action": "sensor",
        "status": "100",
        "page": 1,
        "createdateEndsporttime": null,
        "heart": "101",
        "heartratedevicename": null,
        "deviceidsportstep": null,
        "sportdistance": null,
        "sportcalorie": null,
        "reserve5": null,
        "reserve3": null,
        "reserve2": null,
        "sleeplow": null,
        "reserve4": null,
        "sleeptotal": null,
        "lbsinfo": null,
        "sleepdeep": null,
        "longitude": null,
        "reserve1": null,
        "latitude": null,
        "createDate": 1508754670000,
        "updateBy": null,
        "sysOrgCode": null,
        "createBy": null,
        "updateName": null,
        "createName": null,
        "updateDate": null,
        "userId": "626111000053511402881035ebd51e0015ebd5353590001",
        "diastolicsysCompanyCode": null,
        "realname": null,
        "rows": 10,
        "createdateBegin": null,
        "createdateEnd": null,
        "systolic": null,
        "ox": null,
        "sportdistanceheart": "200",
        "diastolic": null,
        "sleepdeepdeviceid": "626111000053511",
        "heartrate": null,
        "longitude": null,
        "sporttime": null,
        "sleeptotal": null,
        "sleeplow": null,
        "lbsinfo": null,
        "sportstep": null,
        "latitude": null,
        "sportcalorie": null,
        "reserve1": null,
        "devicename": null,
        "reserve2": null,
        "reserve3": null,
        "reserve5": null,
        "reserve4": null,
        "rows": 10,
        "createdateBegin": null,
        "sysCompanyCode": null,
        "createDate": null,
        "updateName": null,
        "createName": null,
        "sysOrgCode": null,
        "updateBy": null,
        "updateDate": null,
        "createBy": null,
        "userIdtestType": "123心率"
    },
    "error": "",
    "statusCode": "000000",
    "error": ""
}

3,智能手表统计接口
[POST] http://127.0.0.1/healthCare/rest/watchController/getEntityByDeviceid 
body :{
    "userId": "402881035ebd51e0015ebd5353590001",
    "deviceid": "626111000053511",
    "testType": "心率",
    "createdateBegin": "2017-10-01",
    "createdateEnd": "2017-10-07"
}//备注://测试类型参数testType: 【sos报警/摔倒报警/血压/心率/计步器/睡眠/血氧】

返回结果:{
    "result": [
        {
            "heart_sum": 8027,//心率
            "heart_avg": "101.61",
            "heart_amax": "50",
            "heart_min": "101",
            "systolic_sum": "101",//血压高压统计
            "systolic_avg": "101",
            "systolic_amax": "101",
            "systolic_min": "101",
            "diastolic_sum": "101",//血压低压统计
            "diastolic_avg": "101",
            "diastolic_amax": "101",
            "diastolic_min": "101",
            "heartrate_sum": "101",//血压心率值统计
            "heartrate_avg": "101",
            "heartrate_amax": "101",
            "heartrate_min": "101",
            "sportstep_sum": "101",//计步器运动步数
            "sportstep_avg": "101",
            "sportstep_amax": "101",
            "sportstep_min": "101",
            "sportdistance_sum": "101",//计步器运动里程(公里)
            "sportdistance_avg": "101",
            "sportdistance_amax": "101",
            "sportdistance_min": "101",
           "sportcalorie_sum": "101", //计步器运动消耗的卡路里
            "sportcalorie_avg": "101",
            "sportcalorie_amax": "101",
            "sportcalorie_min": "101",
            "sporttime_sum": "101",//计步器运动时长(分钟)
            "sporttime_avg": "101",
            "sporttime_amax": "101",
            "sporttime_min": "101",
            "sleeptotal_sum": "101",//睡眠睡眠总时长(分钟)
            "sleeptotal_avg": "101",
            "sleeptotal_amax": "101",
            "sleeptotal_min": "101",
            "sleeplow_sum": "101",//睡眠浅睡眠时长(分钟)
            "sleeplow_avg": "101",
            "sleeplow_amax": "101",
            "sleeplow_min": "101",
            "sleepdeep_sum": "101",//睡眠深睡眠时长(分钟)
            "sleepdeep_avg": "101",
            "sleepdeep_amax": "101",
            "sleepdeep_min": "101",
            "ox_sum": "101",//血氧深睡眠时长(分钟)
            "ox_avg": "101",
            "ox_amax": "101",
            "ox_min": "101",
            "testtime": "2017-10-23"
        }
    ],
    "statusCode": "000000",
    "error": ""
}

十五、尿检:
1,添加测量数据
```java
[post] rest/hUrineTestController 
body:{
          "userid":"",//用户id
          "token":"",
          "leu":"",//白细胞
          "nit":"",//亚硝酸盐
          "ubg":"",//尿胆原
          "pro":"",//蛋白质
          "ph":"",//ph
          "bld":"",//潜血
          "sg":"",//比重
          "ket":"",//酮体
          "bil":"",//胆红素
          "glu":"",//葡萄糖
          "vc":"",//vc
          "bil":"",//胆红素
          "source":"",//数据来源(ios,android,wx)
          "boundtype":"",//绑定类型,暂时只有bluetooth
          "name":"",//设备名称
        }
        
result:{
    "result": {
        "name": "apple watch 38mm",
        "id": "ff8080815fb427f2015fb42adf1f0000",
        "source": "ios",
        "createDate": 1510556229398,
        "leu": "2",
        "nit": "3",
        "ubg": "4",
        "pro": "5",
        "ph": "6",
        "bld": "3",
        "sg": "2",
        "ket": "1",
        "bil": "2",
        "glu": "2",
        "vc": "3",
        "boundtype": "bluetooth",
        "userid": "ff8080815f291a71015f291aeb400000"
    },
    "error": "",
    "statusCode": "000000"
}    
error:{"result":"","error":"ph丢失","statusCode":"666666"}

2,通过数据id查看数据
[get] rest/hUrineTestController/{id}
result:{"result":{},"error":"","statusCode":"000000"}

3,通过用户id查看数据
[post] rest/hUrineTestController/get
body:{
          "userid":"",//用户id
          "startindex":"",//起始下标,分页用
          "pagesize":"",//每页条数
          "begincreatetime":"2017-01-01 12:01:21" ,
          "endcreatetime":"2017-01-01 12:01:21"  
        }
result:{"result":[{}],"statusCode":"000000","error":""}

4,统计信息
[get] rest/hUrineTestController/count/{userid}/{field}/{starttime}/{endtime} 
//{用户id,字段:(),开始时间(yyyy-MM-dd) 结束时间(yyyy-MM-dd)}
field:{leu|nit|ubg|pro|ph|bld|sg|ket|bil|glu|vc}
result:{
    "result": [
        {
            "date": "2017-10-20",
            "field": "vc",
            "max": "5",
            "min": "1",
            "avg": 3
        }
    ],
    "error": "",
    "statusCode": "000000"
}

5,查看时间范围内指定指标最大的血压数据
[post] rest/hUrineTestController/max
body:{
        "time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
        "field":"",//{leu|nit|ubg|pro|ph|bld|sg|ket|bil|glu|vc}
        "userid":""
        }
result:{
    "result": [
        {
            "name": "apple watch 38mm",
            "id": "ff8080815fb427f2015fb42adf1f0000",
            "createDate": 1510556229000,
            "source": "ios",
            "userid": "ff8080815f291a71015f291aeb400000",
            "leu": "2",
            "nit": "3",
            "ubg": "4",
            "pro": "5",
            "ph": "6",
            "bld": "3",
            "sg": "2",
            "ket": "1",
            "bil": "2",
            "glu": "2",
            "vc": "3",
            "boundtype": "bluetooth"
        }
    ],
    "statusCode": "000000",
    "error": ""
}
error:{"result":"","statusCode":"666666","error":"字段格式不正确"}

6,查看时间范围内指定指标最小的血压数据
[post] rest/hUrineTestController/min
body:{
        "time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
        "field":"",//{leu|nit|ubg|pro|ph|bld|sg|ket|bil|glu|vc}
        "userid":""
        }
result:{"result":[],"error":"","statusCode":"000000"}

十六、心电检测:
1,添加测量数据
[post] rest/hElectrocardingraphyController 
body:{
          "userid":"",//用户id
          "token":"",
          "hr":"",//心率
          "result":"",//测量结果
          "source":"",//数据来源(ios,android,wx)
          "boundtype":"",//绑定类型,暂时只有bluetooth
          "name":"",//设备名称
        }
        
result:{
    "result": {
        "name": "apple watch 38mm",
        "id": "ff8080815fb4552a015fb4592cc30000",
        "result": "心跳蹦蹦的",
        "userid": "ff8080815f291a71015f291aeb400000",
        "source": "ios",
        "createDate": 1510559263848,
        "hr": "3",
        "boundtype": "bluetooth"
    },
    "error": "",
    "statusCode": "000000"
}
error:{"result":"","error":"result丢失","statusCode":"666666"}

2,通过数据id查看数据
[get] rest/hElectrocardingraphyController/{id}
result:{"result":{},"error":"","statusCode":"000000"}

3,通过用户id查看数据
[post] rest/hElectrocardingraphyController/get
body:{
          "userid":"",//用户id
          "startindex":"",//起始下标,分页用
          "pagesize":"",//每页条数
          "begincreatetime":"2017-01-01 12:01:21" ,
          "endcreatetime":"2017-01-01 12:01:21"  
        }
result:{"result":[{}],"statusCode":"000000","error":""}

4,统计信息
[get] rest/hElectrocardingraphyController/count/{userid}/{starttime}/{endtime} 
//{用户id,字段:(),开始时间(yyyy-MM-dd) 结束时间(yyyy-MM-dd)}
result:{
    "result": [
        {
            "date": "2017-10-20",
            "field": "hr",
            "max": "5",
            "min": "1",
            "avg": 3
        }
    ],
    "error": "",
    "statusCode": "000000"
}

5,查看时间范围内指定指标最大的血压数据
[post] rest/hElectrocardingraphyController/max
body:{
        "time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
        "userid":""
        }
result:{
    "result": [
        {
            "name": "apple watch 38mm",
            "id": "ff8080815fb4552a015fb4592cc30000",
            "result": "心跳蹦蹦的",
            "userid": "ff8080815f291a71015f291aeb400000",
            "source": "ios",
            "createDate": 1510559264000,
            "hr": "3",
            "boundtype": "bluetooth"
        }
    ],
    "statusCode": "000000",
    "error": ""
}
error:{"result":"","statusCode":"666666","error":"字段格式不正确"}

6,查看时间范围内指定指标最小的血压数据
[post] rest/hElectrocardingraphyController/min
body:{
        "time":"",//{一天:1d,一周1w,一月:1m,一年:1y}
        "userid":""
        }
result:{"result":[],"error":"","statusCode":"000000"}

作者:Cabigail
链接:https://www.jianshu.com/p/a7e6696d1c09
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

推荐阅读更多精彩内容