[关闭]
@lina 2018-12-21T13:38:13.000000Z 字数 21351 阅读 504

志愿医生接口文档1.0

列表项

志愿医生 1.0

1、项目约定

1.1 基本约定

1.1.1 API Base Url

1.1.2 鉴权字段(身份标识)

  • token : [string] 登录后获取的 token 信息,请将此字段至于请求头中,详见1.1.3

1.1.3 HTTP请求中字段要求

  • X-auth-token : [string] 登录后获取的 token 信息, 取window.token 请求头带此字段
  • X-location : [string] 坐标 lng-lat 请求头带此字段

1.1.4 图片裁图规则

1.2 通用接口

1.2.1 通用接口URL

1.2.2 上传图片

通用图片上传文件服务

请求URL

POST
/imgupload

请求参数

  • file : 文件

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. url: 'http://xxx'
  5. }
  6. }
  • url : [string] 文件的访问URL

1.2.3 验证码图片

注:请求图片时,需解析图片的cookie,不然无法认证
请求URL

GET
/captcha/app

1.2.4 发送短信

请求URL

POST
/verifycode

请求参数

  • captcha_code : [string] 图形验证码
  • phone : [string] 手机号

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

1.2.5 城市列表接口

请求URL

get
/city

请求参数

  • parent_id : [integer] 当不传值时,取parent_id=0的数据,即省、直辖市

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. {
  6. "id": 0,
  7. "parent_id": 0,
  8. "name": "string",
  9. "short_name": "string",
  10. "pinyin": "string",
  11. "sort": 0,
  12. }
  13. ]
  14. }
  15. }

1.2.6 城市下区域接口

请求URL

get
/area/city

请求参数

  • name : [string] 城市名称

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. {
  6. "id": 0,
  7. "parent_id": 0,
  8. "name": "string",
  9. "short_name": "string",
  10. "pinyin": "string",
  11. "sort": 0,
  12. }
  13. ]
  14. }
  15. }

1.3 通用响应字段

1.3.1 状态字段

  • error_code: [int] 服务器状态码,0 为正常状态,异常状态待定。
  • error_message:[string] 错误信息,但 error_code 不为 0 时返回

1.3.2 数据字段

  • data: [object] 数据字段,所有响应数据都在此字段中
  • list: [array],当返回数据为列表时会将数据放在该字段

1.3.3 分页字段

  • page: [object] 分页信息,当返回数组数据时会携带该字段
    • current_page: [int] 当前页码,默认为1
    • total_page: [int] 总页数
    • count: [int] 总数
    • page_size: [int] 每页数量:本项目常用page_size==10

示例

  1. {
  2. error_code: 0,
  3. data: {
  4. key: value,
  5. list: [{
  6. key: value
  7. }],
  8. page {
  9. }
  10. }
  11. }

2、数据结构

2.1 常用字段含义

2.1.1 banner跳转字段

jump_mode:[int]

0: 不跳转
1: 跳转至链接 href字段

2.2 核心结构

2.2.1 banner广告

  1. {
  2. id: 1,
  3. title: '活动',
  4. photo: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
  5. jump_mode: 2
  6. jump_id: 1,
  7. href: '',
  8. }
  • id: [int] ID
  • title: [string] 广告titlee
  • photo: [string] 广告图片地址
  • jump_mode: [integer] 跳转类型,详见2.1
  • jump_id: 跳转的指向id,根据jump_mode含义跳转
  • href: [string] 根据jump_mode会有相应的值

2.2.2 新闻公告

  1. {
  2. id: 1,
  3. title: '活动',
  4. photo: 'http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',
  5. content: "<div>富文本</div>"
  6. publish_time: "2017-02-17 13:00:00",
  7. }
  • id: [int] ID
  • title: [string] title
  • photo: [string] logo图片
  • content: [string] 富文本内容
  • publish_time: [string] 发布时间

2.2.3 患者信息

  1. {
  2. id: 1,
  3. real_name: '张三',
  4. phone: '15512341234',
  5. avatars: "http://baidu.com/image"
  6. idno: "111000197807138521",
  7. sex: 1,
  8. birthday: '1988-08-23',
  9. age: 29,
  10. email: "email@qq.com",
  11. height: "172",
  12. weight: "89",
  13. province_id: 110000,
  14. province_name: "北京",
  15. city_id: 111000,
  16. city_name: "北京市",
  17. county_id: 111010,
  18. county_name: "朝阳区",
  19. addr: "国贸三期",
  20. marital_status: 1,
  21. drink_status: 1,
  22. smoking_status: 1,
  23. credit_score: '3.4',
  24. punctuality_score: '4.5',
  25. is_verify: 1,
  26. join_project_count: 3,
  27. done_project_count: 2,
  28. token: "6f476a45e20898330f07cbc4ff03e3df5a35203f36e3c",
  29. }
  • id: [int] ID
  • real_name: [string] 真实姓名
  • phone: [string] 手机号
  • avatars: [string] 头像
  • idno: [string] 身份证号码
  • sex: [string] 性别 1男 2女
  • birthday: [string] 生日
  • age: [integer] 年龄
  • email: [string] 邮件
  • height: [string] 身高
  • weight: [string] 体重
  • province_id: [integer] 省份id
  • province_name: [string] 省份名称
  • city_id: [integer] 城市id
  • city_name: [string] 城市名称
  • county_id: [integer] 区县id
  • county_name: [string] 区县名称
  • addr: [string] 地址
  • marital_status: [integer] 婚姻状况 0未婚 1已婚 2离异 3丧偶
  • drink_status: [integer] 是否饮酒 0不喝 1喝酒
  • smoking_status: [integer] 是否抽烟 0不抽烟 1抽烟
  • credit_score: [string] 诚信分
  • punctuality_score: [string] 守时分
  • is_verify: [integer] 是否验证通过 0待核验 1启用 2禁用
  • join_project_count: [integer] 成功挂号次数
  • done_project_count: [integer] 就诊次数
  • token: [string] token

2.2.4 医生信息(V2.0修改)

  1. {
  2. id: 1,
  3. real_name: '张三',
  4. phone: '15512341234',
  5. avatars: "http://baidu.com/image"
  6. idno: "111000197807138521",
  7. hospital: '省人民医院',
  8. departments: "内科",
  9. job_position: "主任",
  10. good_at: "擅长",
  11. work_photo: ['http://img','http://img',],
  12. abstract: '个人简介',
  13. visits_count: 10,
  14. patient_count: 30,
  15. service_time_long: 400,
  16. work_time: [{'morning':1, 'afternoon':0},{'morning':1, 'afternoon':0},{'morning':1, 'afternoon':0},{'morning':1, 'afternoon':0},{'morning':1, 'afternoon':0},{'morning':1, 'afternoon':0},{'morning':1, 'afternoon':0},],
  17. is_verify: 1,
  18. score: '4.5',
  19. token: "6f476a45e20898330f07cbc4ff03e3df5a35203f36e3c",
  20. org_list: [{
  21. @组织信息
  22. }]
  23. }
  • id: [int] ID
  • real_name: [string] 真实姓名
  • phone: [string] 手机号
  • avatars: [string] 头像
  • idno: [string] 身份证号码
  • hospital: [string] 工作医院
  • departments: [string] 科室
  • job_position: [string] 职称
  • work_photo: [array] 工作证明材料
  • abstract: [string] 个人简介
  • visits_count: [integer] 出诊次数
  • patient_count: [integer] 服务病人数
  • service_time_long: [integer] 服务时长 单位分
  • work_time: [array] 工作时间,长度为7的数组
  • is_verify: [integer] 是否验证通过 0待核验 1启用 2禁用
  • score: [string] 评分
  • token: [string] token
  • org_list: [array] 组织信息列表

2.2.5 医助信息

  1. {
  2. id: 1,
  3. real_name: '张三',
  4. phone: '15512341234',
  5. avatars: "http://baidu.com/image"
  6. idno: "111000197807138521",
  7. email: "email@qq.com",
  8. team_name: '省人民医院',
  9. province_id: 110000,
  10. province_name: "北京",
  11. city_id: 111000,
  12. city_name: "北京市",
  13. county_id: 111010,
  14. county_name: "朝阳区",
  15. addr: "国贸三期",
  16. help_count: 10,
  17. is_verify: 1,
  18. token: "6f476a45e20898330f07cbc4ff03e3df5a35203f36e3c",
  19. }
  • id: [int] ID
  • real_name: [string] 真实姓名
  • phone: [string] 手机号
  • avatars: [string] 头像
  • idno: [string] 身份证号码
  • email: [string] 邮件
  • team_name: [string] 志愿团队
  • province_id: [integer] 省份id
  • province_name: [string] 省份名称
  • city_id: [integer] 城市id
  • city_name: [string] 城市名称
  • county_id: [integer] 区县id
  • county_name: [string] 区县名称
  • addr: [string] 地址
  • help_count: [integer] 帮扶病人数
  • is_verify: [integer] 是否验证通过 0待核验 1启用 2禁用
  • token: [string] token

2.2.6 病例信息

  1. {
  2. id: 1,
  3. photo: ['http://oss-static-resource.oss-cn-beijing.aliyuncs.com/image/2017-03-09/35ca97afe5194f27eaf15a9cac6ef279.jpeg',]
  4. content: "病例"
  5. }
  • id: [int] ID
  • photo: [array] 病例图片
  • content: [string] 病例描述

2.2.7 消息信息

  1. {
  2. id: 123,
  3. type: 1,
  4. title: '标题',
  5. content: '文字描述',
  6. publish_time: '2017-09-25 23:05:23',
  7. username: "wang59",
  8. avatars: "http://image.com/1.jpeg"
  • id: [integer] ID
  • type: [integer] 类型 0全量消息,1单发消息
  • title: [string] 标题
  • content: [string] 内容
  • publish_time: [string] 发布时间
  • username: [string] 消息发送人
  • avatars: [string] 消息发送人头像

2.2.8 义诊信息(V2.0修改)

  1. {
  2. id: 123,
  3. date: "2018-03-01",
  4. begin: '09:00:00',
  5. end: '11:00:00',
  6. people_count: 20,
  7. join_people_count: 13,
  8. addr: "地点",
  9. lng: "127.000000",
  10. lat: "39.00000",
  11. abstract: "活动简介",
  12. price: 50,
  13. status: 1,
  14. progress_status: 1,
  15. service_target: ['老年人'],
  16. hospital_info: @医院信息
  17. doctor_info: @医生信息,
  18. join_user: [@患者信息],
  19. project_status: 1,
  20. op_cancel: 1,
  21. is_join: 1,
  22. assistant_join_count: 2,
  23. plan_time: {
  24. "15:23:00 - 15:53:00": 7,
  25. "15:53:00 - 16:23:00": 7,
  26. "16:23:00 - 16:53:00": 7,
  27. "16:53:00 - 17:23:00": 7,
  28. "17:23:00 - 17:53:00": 7,
  29. "17:53:00 - 18:23:00": 7,
  30. "18:23:00 - 18:53:00": 7,
  31. "18:53:00 - 19:23:00": 7,
  32. "19:23:00 - 19:53:00": 6,
  33. "19:53:00 - 20:23:00": 6,
  34. "20:23:00 - 20:53:00": 6
  35. }
  • id: [integer] ID
  • date: [string] 义诊日期
  • begin: [string] 义诊开始时间
  • end: [string] 义诊结束时间
  • people_count: [integer] 人数
  • join_people_count: [integer] 参加人数
  • addr: [string] 地址
  • lng: [string] 经度
  • lat: [string] 纬度
  • abstract: [string] 义诊简介
  • price: [integet] 押金
  • progress_status: [integer] 活动状态 1可预约 2已约满 3已结束
  • service_target: [array] 服务对象
  • hospital_info: [string] 医院信息
  • doctor_info: [string] 医生信息
  • join_user: [array] 加入的用户
  • project_status: [int] 义诊状态 1待出诊 2出诊中 3已结束
  • op_cancel: [int] 医生是否能取消,患者是否可以退出 0不能 1可以
  • is_join: [int] 是否加入 0不能 1可以
  • assistant_join_count: [int] 医助协助加入的人数,医助端我的挂号接口下发
  • plan_time: [object] 每个时间段的可挂号数

2.2.9 诊断信息

患者加入义诊项目后,为一次诊断

  1. {
  2. id: 123,
  3. assistant_user_id: 1,
  4. verify_status: 1,
  5. reject_msg: '111',
  6. visit_time: '2017-08-03 15:33:33',
  7. diag_result: 1,
  8. diag_photo: ['image_url'],
  9. status: 1,
  10. refund_status: 1,
  11. patient_credit_score: 3,
  12. patient_punctuality_score: 4,
  13. doctor_comment_time: '2018-03-04 15:33:33',
  14. doctor_score: 4,
  15. doctor_comment: '亲切',
  16. patient_comment_time: '2018-03-04 15:33:33',
  17. user_info: [@患者信息],
  18. casebook_info: [@病例信息],
  • id: [integer] ID
  • assistant_id: [integer] 医助id 如不为0 则是医助协助
  • verify_status: [integer] 审核状态 1预约成功 2预约被拒绝 3已取消
  • reject_msg: [string] 拒绝原因 如拒绝,不为空
  • visit_time: [string] 义诊就诊时间
  • diag_result: [string] 诊断结果
  • diag_photo: [string] 诊断照片
  • status: [integer] 状态 1待诊 2未诊 3已诊
  • refund_status: [integer] 1已申请退款(退款中) 2退款中(中间状态,前端忽略) 3退款完成
  • patient_credit_score: [integer] 医生对患者的诚信评分
  • patient_punctuality_score: [string] 医生对患者的守时评分
  • doctoy_comment_time: [string] 医生对患者评论的时间,即patient_credit_score和doctoy_commet_time产生的时间
  • doctor_score: [integer] 患者对医生评分
  • doctor_comment: [string] 患者对医生评价
  • patient_comment_time: [string] 患者对医生的评论时间患者对医生的评论时间, 即doctor_score和doctor_comment产生的时间
  • user_info: [object] 患者信息
  • casebook_info: [object] 病例信息

2.2.10 医院信息

  1. {
  2. id: 123,
  3. name: '人民医院',
  4. logo: "imgae_url",
  5. banner: ["imgae_url"],
  6. level: '三甲医院',
  7. tag: '心血管科',
  8. province_id: 110000,
  9. province_name: "北京",
  10. city_id: 111000,
  11. city_name: "北京市",
  12. county_id: 111010,
  13. county_name: "朝阳区",
  14. addr: "国贸三期",
  • id: [integer] ID
  • name: [string] 医院名称
  • logo: [string] logo
  • banner: [array] banner
  • level: [string] 级别
  • tag: [string] 标签 特色
  • province_id: [integer] 省份id
  • province_name: [string] 省份名称
  • city_id: [integer] 城市id
  • city_name: [string] 城市名称
  • county_id: [integer] 区县id
  • county_name: [string] 区县名称
  • addr: [string] 地址

2.2.11 组织信息(V2.0新增)

  1. {
  2. id: 123,
  3. name: 'xx组织',
  4. logo: "imgae_url",
  5. abstract: "xxxx",
  • id: [integer] ID
  • name: [string] 医院名称
  • logo: [string] logo
  • abstract: [string] 组织简介

2.2.12 专题活动信息(V2.0新增)

  1. {
  2. id: 123,
  3. date: "2018-03-01",
  4. begin: '09:00:00',
  5. end: '11:00:00',
  6. people_count: 20,
  7. join_people_count: 13,
  8. addr: "地点",
  9. lng: "127.000000",
  10. lat: "39.00000",
  11. abstract: "活动简介",
  12. photo: "活动url"
  13. price: 50,
  14. status: 1,
  15. progress_status: 1,
  16. service_target: ['老年人'],
  17. hospital_info: @医院信息,
  18. org_info: @组织信息,
  19. project_status: 1,
  20. join_user: [@患者信息],
  • id: [integer] ID
  • date: [string] 义诊日期
  • begin: [string] 义诊开始时间
  • end: [string] 义诊结束时间
  • people_count: [integer] 人数
  • join_people_count: [integer] 参加人数
  • addr: [string] 地址
  • lng: [string] 经度
  • lat: [string] 纬度
  • abstract: [string] 专题活动简介
  • photo: [string] 专题活动图片url
  • price: [integet] 押金
  • progress_status: [integer] 活动状态 1可预约 2已约满 3已结束
  • service_target: [array] 服务对象
  • hospital_info: [string] 医院信息
  • org_info: [object] 组织信息
  • project_status: [int] 义诊状态 1待出诊 2出诊中 3已结束
  • join_user: [array] 加入的用户

2.2.13 留言信息(V2.0新增)

  1. {
  2. id: 123,
  3. type: 1,
  4. from_user_id: 2,
  5. to_user_id: 1
  6. content: "xxxx",
  7. photo: "xxxx",
  8. is_read: 0",
  9. dialog_id: 0",
  10. from_user: {
  11. real_name: 'xx',
  12. avatars: 'http://www.xx.com'
  13. },
  14. to_user: {
  15. real_name: 'xx',
  16. avatars: 'http://www.xx.com'
  17. }
  18. }
  • id: [integer] ID
  • type: [integer] 消息发送者的类型: 1表示患者,2表示医生
  • from_user_id: [integer] 消息发送者user_id
  • to_user_id: [integer] 消息接受者user_id
  • content: [string] 消息内容
  • photo: [array] 消息图片列表,最多三张
  • is_read: [integer] 0 未读, 1 已读
  • dialog_id: [string] 该聊天记录所属哪个对话

2.2.14 留言对话对象信息(V2.0新增)

  1. {
  2. id: 123,
  3. patient_user_id: 12,
  4. doctor_user_id: 13,
  5. last_msg_id: "xxxx",
  6. last_msg: {
  7. @留言信息
  8. }
  9. patient_user: {
  10. @用户信息
  11. },
  12. doctor_user: {
  13. @用户信息
  14. }
  • id: [integer] 留言对话id(对应chat_dialog中的id)
  • patient_user_id: [integer] 患者user_id
  • doctor_user_id: [integer] 医生user_id
  • last_msg_id: [string] 最后一条信息的id(chat_message表中id)
  • last_msg: [object]最后一条信息的消息体(根据这个可以判断消息是否已读未读)

3、接口列表

3.1 用户接口

3.1.1 注册接口

注:根据返回的个人信息,来判断跳转的页面是个人中心还是补全信息页
请求URL

POST
/register

请求参数

  • phono: [string] 手机号码 【必填】
  • verify_code: [string] 验证码 【必填】
  • pwd: [string] 密码【必填】
  • type: [integer] 用户类型 1患者 2医生 3医助【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @用户信息 (根据type动态返回结构)
  5. }
  6. }

3.1.2 登陆接口

请求URL

POST
/login

请求参数

  • phono: [string] 手机号码 【必填】
  • pwd: [string] 密码【必填】
  • type: [integer] 用户类型 1患者 2医生 3医助【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @用户信息(根据type动态返回结构)
  5. }
  6. }

3.1.3 患者补全信息接口

请求URL

PUT
/user

请求参数

  • avatars: [url] 头像 【非必填】
  • real_name: [string] 真实姓名 【必填】
  • idno: [string] 身份证号 【必填】
  • height: [string] 身高 【必填】
  • weight: [string] 体重 【必填】
  • marital_status: [integer] 婚否 0未婚 1已婚 【必填】
  • drink_status: [integer] 是否饮酒 0不饮酒 1饮酒 【必填】
  • smoking_status: [integer] 是否抽烟 0不抽烟 1抽烟 【必填】
  • email: [string] 邮箱 【非必填】
  • province_id: [integer] 省份id 【非必填】
  • city_id: [integer] 城市id 【非必填】
  • county_id: [integer] 区县id 【非必填】
  • addr: [string] 详细地址 【非必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @患者信息
  5. }
  6. }

3.1.4 医生补全信息接口

注:接口地址跟患者补全信息接口一致,后端会根据token来判断
请求URL

PUT
/user

请求参数

  • avatars: [url] 头像 【非必填】
  • real_name: [string] 真实姓名 【必填】
  • idno: [string] 身份证号 【必填】
  • hospital_id: [string] 医院id 【必填】
  • departments: [string] 科室 【必填】
  • job_position: [string] 职位 【必填】
  • good_at: [string] 擅长 【必填】
  • province_id: [integer] 省份id 【非必填】
  • city_id: [integer] 城市id 【非必填】
  • county_id: [integer] 区县id 【非必填】
  • addr: [string] 详细地址 【非必填】
  • work_photo: [array] 工作证明材料 图片 【必填】
  • abstract: [string] 个人简介 【非必填】
  • work_time: [string] json格式 工作时间,格式参考医生信息中的work_time 【非必填】
  • email: [string] email 【非必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @医生信息
  5. }
  6. }

3.1.5 医助补全信息接口

注:接口地址跟患者补全信息接口一致,后端会根据token来判断
请求URL

PUT
/user

请求参数

  • avatars: [url] 头像 【非必填】
  • real_name: [string] 真实姓名 【必填】
  • idno: [string] 身份证号 【必填】
  • team_name: [string] 团队名称 【必填】
  • province_id: [integer] 省份id 【非必填】
  • city_id: [integer] 城市id 【非必填】
  • county_id: [integer] 区县id 【非必填】
  • addr: [string] 详细地址 【非必填】
  • email: [string] 邮箱 【非必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @医助信息
  5. }
  6. }

3.1.6 用户信息接口(登陆用户)

请求URL

get
/user

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @用户信息(根据type动态返回结构)
  5. }
  6. }

3.1.7 修改密码和找回密码接口

注:根据返回的个人信息,来判断跳转的页面是个人中心还是补全信息页, 使用3.1.11接口发送短信

请求URL

POST
/reset/pwd

请求参数

  • phono: [string] 手机号码 【必填】
  • verify_code: [string] 验证码 【必填】
  • pwd: [string] 密码【必填】
  • type: [integer] 用户类型 1患者 2医生 3医助【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.1.8 关注用户接口

get
/follow/user/{id}

请求参数

  • id: 用户id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.1.9 取消关注用户接口

delete
/follow/user/{id}

请求参数

  • id: 用户id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.1.10 用户信息接口(根据id)

get
/user/{id}

请求参数

  • id: 用户id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @用户信息(根据type动态返回结构)
  5. }
  6. }

3.1.11 发送短信接口(无图片验证码)

请求URL

POST
/phone/verifycode

请求参数

  • phone: phone【必填】

响应

  1. {
  2. "error_code": 0,
  3. "data":{
  4. },
  5. "error_message": ""
  6. }

3.1.12 退出登录接口 [退出请务必调用此接口]

请求URL

get
/logout

响应

  1. {
  2. "error_code": 0,
  3. "data":{
  4. },
  5. "error_message": ""
  6. }

3.1.13 我的消息接口

请求URL

get
/message

请求参数

  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. "error_code": 0,
  3. "data":{
  4. "list":[
  5. @消息信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. },
  11. "error_message": ""
  12. }

3.1.14 手机号注册登陆接口 【V2.0新增】

请求URL

post
/login/phone

请求参数

  • photo: [string] 手机号码 【必填】
  • verify_code: [string] 验证码 【必填】

响应

  1. {
  2. "error_code": 0,
  3. "data":{
  4. @用户信息
  5. is_new: 1 // is_new表示是否为注册的
  6. },
  7. "error_message": ""
  8. }

3.2 医生端接口

3.2.1 我的医助接口

请求URL

GET
/doctor/assistant

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @医助信息
  6. ]
  7. }
  8. }

3.1.14 微信素材下载

请求URL

get
/weixin/media

请求参数

  • media_id: [string] 素材id【必填】

响应

  1. {
  2. "error_code": 0,
  3. "data":{
  4. 'url':'http://img.jpg',
  5. },
  6. "error_message": ""
  7. }

3.2.2 医助信息接口[参考3.1.10]

请求URL

同3.1.10

3.2.3 发布义诊接口

请求URL

POST
/project

请求参数

  • date: [string] 义诊日期 【必填】 2018-02-25
  • begin: [string] 开始时间 【必填】 09:30:00
  • end: [string] 结束时间 【必填】 11:00:00
  • people_count: [integer] 义诊人数【必填】
  • lng: [string] 经度 【必填】
  • lat: [string] 纬度 【必填】
  • addr: [string] 义诊地址 【必填】
  • service_target: [array] 服务对象 【必填】
  • abstract: [string] 活动简介 【必填】
  • price: [integer] 挂号押金 【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @义诊信息
  5. }
  6. }

3.2.4 义诊列表接口

请求URL

GET
/doctor/project

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @义诊信息
  6. ]
  7. }
  8. }

3.2.5 义诊详情接口

请求URL

GET
/project/{id}

请求参数

  • id: [integer] 义诊id 【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @义诊信息
  5. }
  6. }

3.2.6 取消义诊接口

请求URL

GET
/project/{id}/cancel

请求参数

  • id: [integer] 义诊id 【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.2.7 义诊病人列表接口

请求URL

GET
/project/{id}/patient

请求参数

  • id: [integer] 义诊id 【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @诊断信息
  6. ]
  7. }
  8. }

3.2.18 我的评论列表接口

会将对医生有评论评论的诊断列出来
请求URL

GET
/doctor/comment

请求参数

  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @诊断信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.2.8 我的义诊病人列表接口

请求URL

GET
/doctor/project/patient

请求参数

  • status: 1待诊 2未诊 3已诊【非必填】
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @诊断信息
  6. ]
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.2.9 诊断信息接口

患者加入义诊项目后,为一次诊断
请求URL

GET
/diagnoses/{id}

请求参数

  • id: 诊断id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @诊断信息
  5. }
  6. }

3.2.10 拒绝诊断接口

请求URL

POST
/diagnoses/{id}/reject

请求参数

  • id: 诊断id【必填】
  • reject_msg: 【string】 拒绝原因【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.2.11 诊断确认就诊接口

请求URL

GET
/diagnoses/{id}/done

请求参数

  • id: 诊断id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.2.12 医生对患者评论接口

请求URL

POST
/doctor/diagnoses/{id}/comment

请求参数

  • id: 诊断id【必填】
  • patient_credit_score: 【integer】 诚信分【必填】
  • patient_punctuality_score: 【integer】 守时分【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.2.13 添加诊断结果接口

请求URL

PUT
/diagnoses/{id}

请求参数

  • id: 诊断id【必填】
  • diag_result: 【string】 诊断结果【必填】
  • diag_photo: 【array】 诊断结果照片数组【非必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.2.14 公告列表接口

请求URL

GET
/news/{type}/list

请求参数

  • type: 类型【必填】 1患者端公告 2医生端 3医助端
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @新闻信息
  6. ]
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.2.15 公告详情接口

请求URL

GET
/news/{id}

请求参数

  • id: id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @新闻信息
  5. }
  6. }

3.2.16 首页接口

请求URL

/doctor/index

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "news":[
  5. @新闻信息
  6. ],
  7. "doctor_info":@医生信息,
  8. "project_list":[
  9. @义诊信息
  10. ],
  11. "diagnoses_list":[
  12. @诊断信息
  13. ]
  14. }
  15. }

3.2.17 医院列表接口

请求URL

同3.3.1,page_size传一个较大值即可

3.2.18 获取组织列表(V2.0新增)

请求URL

GET
/org

请求参数

  • keyword: 组织名称搜索

注意区别3.2.21接口,本接口是加入的时候选择列表

响应

  1. {
  2. "error_code": 0,
  3. "data":{
  4. "list": [
  5. @组织信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. },
  11. "error_message": ""
  12. }

3.2.19 加入组织(V2.0新增)

请求URL

POST
/org_add/{org_id}

请求参数

org_id为机构id

响应

  1. {
  2. "error_code": 0,
  3. "data": null,
  4. "error_message": ""
  5. }

3.2.20 退出组织(V2.0新增)

请求URL

DELETE
/org_remove/{id}

请求参数

id为我已申请加入的组织列表(见3.2.21接口)返回的id

响应

  1. {
  2. "error_code": 0,
  3. "data": null,
  4. "error_message": ""
  5. }

3.2.21 我已申请加入的组织列表(V2.0新增)

请求URL

GET
/org/my

请求参数

响应

  1. {
  2. "error_code": 0,
  3. "data": {
  4. list: [{
  5. id: 12,
  6. verify_status: 0,
  7. org_id: 12,
  8. doctor_id: 13,
  9. org: {
  10. @组织信息
  11. }
  12. }],
  13. "page":{
  14. @分页字段
  15. }
  16. },
  17. "error_message": ""
  18. }

3.2.22 获取病人所有病例接口(V2.0新增)

请求URL

GET
/all_diagnoses/{id}

请求参数

  • id: 病人的user_id

响应

  1. {
  2. "error_code": 0,
  3. "data": [
  4. {
  5. "id": 2,
  6. "hospital_id": 2,
  7. "assistant_user_id": 0,
  8. "user_id": 8,
  9. "doctor_user_id": 6,
  10. "project_id": 14,
  11. "casebook_id": 1,
  12. "verify_status": 1,
  13. "reject_msg": "",
  14. "visit_time": "2018-04-01 08:30:00",
  15. "status": 3,
  16. "amount": "0.00",
  17. "refund_status": null,
  18. "refund_time": null,
  19. "refund_sn": null,
  20. "confirm_no_refund": 0,
  21. "sn": null,
  22. "diag_result": "好好睡就行了",
  23. "diag_photo": null,
  24. "patient_credit_score": 0,
  25. "patient_punctuality_score": 0,
  26. "patient_comment_show": 1,
  27. "doctor_comment_time": null,
  28. "doctor_score": 3,
  29. "doctor_comment": "123123",
  30. "doctor_comment_show": 1,
  31. "patient_comment_time": "2018-03-31 21:46:55",
  32. "plan_time": null,
  33. "created_at": "2018-04-08 22:42:16",
  34. "updated_at": "2018-04-08 22:42:16",
  35. "casebook": {
  36. "id": 1,
  37. "user_id": 8,
  38. "project_id": 14,
  39. "content": "123123",
  40. "photo": null,
  41. "created_at": "2018-03-26 19:04:58",
  42. "updated_at": "2018-03-26 19:04:58"
  43. },
  44. "doctor": {
  45. "id": 6,
  46. "real_name": "Kobe",
  47. "avatars": "http://.cn/ss.png"
  48. },
  49. "user": {
  50. "id": 8,
  51. "real_name": "郑智勇",
  52. "avatars": "http://a.cn/ss.jpg"
  53. }
  54. },
  55. ],
  56. "error_message": ""
  57. }

3.3 患者端接口

3.3.1 医院列表接口

请求URL

GET
/hospital

请求参数

  • keyword: 搜索【非必填】
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @医院信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.2 义诊列表接口 (v2.0修改)

请求URL

GET
/project

请求参数

  • keyword: 搜索【非必填】
  • sort: 排序方式 【非必填】1离我最近、2最新发布、3热门义诊
  • service_target: 义诊对象 【非必填】 老年人、儿童等
  • departments: 疾病类型 对应的是科室的选择 【非必填】
  • hospital_id: 医院id【非必填】
  • org_id: 机构id【非必填】(v2.0添加)
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @义诊信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.3 义诊详情接口 【参考3.2.5】

请求URL

同3.2.5

3.3.4 加入义诊(V2.0修改)

请求URL

/project/{id}/join

请求参数
POST

  • id: 义诊id【必填】
  • content: 【string】病例信息【必填】
  • photo: 【array】图片 最多三张【非必填】
  • plan_time: 为选择的时间段如:"15:23:00 - 15:53:00"

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.3.5 取消义诊

请求URL

/custom/project/{id}/cancel

请求参数
GET

  • id: 义诊id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.3.6 医生评论列表接口

会将对医生有评论评论的诊断列出来
请求URL

GET
/doctor/{id}/comment

请求参数

  • id: 医生id【必填】
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @诊断信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.7 关注医生接口【参考3.1.8】

请求URL

同3.1.8

3.3.8 获取病例接口

请求URL

GET
/project/{id}/casebook

请求参数

  • id 义诊id 【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @病例信息
  5. }
  6. }

3.3.9 医生列表接口(v2.0修改)

请求URL

GET
/doctor/list

请求参数

  • keyword: 搜索【非必填】
  • sort: 排序方式 【非必填】1评分最高 2热门医生
  • departments: 疾病类型 对应的是科室的选择 【非必填】
  • job_position: 职位 对应的是职位的选择 【非必填】
  • hospital_id: 医院id 【非必填】
  • org_id: 机构id 【非必填】(v2.0新增)
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @医生信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.10 医生信息接口[参考3.1.10]

请求URL

同3.1.10

3.3.11 医生义诊列表接口

请求URL

GET
/custom/doctor/{id}/project

请求参数

  • id: 医生的id【必填】
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @义诊信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.12 我关注的医生接口

请求URL

GET
/custom/follow

请求参数

  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @医生信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.13 我的挂号列表接口

请求URL

GET
/custom/diagnoses

请求参数

  • type: 1已挂号 2挂号失败 3未到诊 4诊疗完成 【非必填】
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @诊断信息
  6. ]
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.14 待评论的医生接口

请求URL

GET
/custom/need/comment

请求参数

  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @诊断信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.3.15 我的退款接口

请求URL

GET
/custom/payment/diagnoses

请求参数

  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. @诊断信息
  5. ],
  6. "page":{
  7. @分页字段
  8. }
  9. }
  10. }

3.3.16 我的医助接口

请求URL

GET
/custom/assistant

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @医助信息
  6. ]
  7. }
  8. }

3.3.17 患者对医生评论接口

请求URL

POST
/custom/diagnoses/{id}/comment

请求参数

  • id: 诊断id【必填】
  • doctor_score: 【integer】 评分【必填】
  • doctor_comment: 【string】 评论【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.3.18 个人中心首页接口

请求URL

GET
/custom/center

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "user_info": @用户信息,
  5. "msg_count": 1,
  6. }
  7. }

3.3.19 首页接口(V2.0修改)

请求URL

GET
/custom/homepage

请求参数

  • hospital_id: 医院id【非必填】 如填写 则获取对应的医院首页数据
  • org_id: 组织id【非必填】 如填写 则获取对应的组织首页数据

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "banner": [@banner广告],
  5. "news": [@新闻公告],
  6. "project_list": [@诊断信息],
  7. "special_pro_list": [@专题活动信息],
  8. }
  9. }

3.3.20 订单查询接口

请求URL

GET
/order/query/{sn}

请求参数

  • sn: 订单流水号

响应

  1. {
  2. "error_code": 0,
  3. "data":{
  4. @诊断信息 //购买成功返回 失败返回空
  5. },
  6. "error_message": ""
  7. }

3.3.21 获取组织列表(V2.0新增)

同 3.2.18

3.4 医助端接口

3.4.1 关注医生接口 【参考3.1.8】

请求URL

同3.1.8

3.4.2 我关注医生列表接口

请求URL

GET
/assistant/follow

请求参数

  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @医生信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.4.3 添加病人(已有账号)接口

使用3.1.11接口发送短信
请求URL

POST
/assistant/bind/patient

请求参数

  • phone: 手机号【必填】
  • verify_code: 验证码【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.4.4 新建病人接口

请求URL

POST
/assistant/create/patient

请求参数

  • avatars: [url] 头像 【非必填】
  • real_name: [string] 真实姓名 【必填】
  • idno: [string] 身份证号 【必填】
  • height: [string] 身高 【必填】
  • weight: [string] 体重 【必填】
  • marital_status: [integer] 婚否 0未婚 1已婚 【必填】
  • drink_status: [integer] 是否饮酒 0不饮酒 1饮酒 【必填】
  • smoking_status: [integer] 是否抽烟 0不抽烟 1抽烟 【必填】
  • email: [string] 邮箱 【非必填】
  • province_id: [integer] 省份id 【非必填】
  • city_id: [integer] 城市id 【非必填】
  • county_id: [integer] 区县id 【非必填】
  • addr: [string] 详细地址 【非必填】
  • pwd: [string] 密码 【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.4.5 我的病人列表接口

请求URL

GET
/assistant/patient

请求参数

  • keyword: 搜索【非必填】
  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @患者信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.4.6 病人信息接口 【参考3.1.10】

请求URL

同3.1.10

3.4.7 加入义诊接口

请求URL

POST
/assistant/join/project/{id}

请求参数

  • id: project id【必填】 integer
  • user_id: 用户id【必填】
  • plan_time: 为选择的时间段如:"15:23:00 - 15:53:00"【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.4.8 我的挂号列表接口

请求URL

GET
/assistant/project

请求参数

  • current_page: 页码【非必填】默认1
  • page_size: 页长【非必填】 默认10

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @义诊信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.4.9 义诊挂号病人列表接口

请求URL

GET
/assistant/project/{id}/paitient

请求参数

  • id: 义诊id

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list": [
  5. @诊断信息
  6. ],
  7. "page":{
  8. @分页字段
  9. }
  10. }
  11. }

3.4.10 取消挂号接口

请求URL

GET
/assistant/diagnoses/{id}/cancel

请求参数

  • id: 诊断id

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. }
  5. }

3.4.11 个人中心首页接口

请求URL

GET
/assistant/center

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "user_info": @用户信息,
  5. "msg_count": 1,
  6. }
  7. }

3.4.12 首页接口

请求URL

GET
/assistant/homepage

请求参数

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "banner": [@banner广告],
  5. "news": [@新闻公告],
  6. "project_list": [@诊断信息],
  7. }
  8. }

3.5 专题活动接口(V2.0新增)

3.5.1 专题活动列表

请求URL

GET
/sp_project

请求参数

  • 分页的一些字段

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @专题活动信息
  6. ],
  7. "page": {
  8. @分页
  9. }
  10. }
  11. }

3.5.2 专题活动的活动列表接口

请求URL

GET
/sp_project/{id}

请求参数

  • id: [integer] 专题活动id 【必填】
  • 分页的一些字段

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @活动信息
  6. ],
  7. "page": {
  8. @分页
  9. }
  10. }
  11. }

3.6 留言消息接口(V2.0新增)

3.6.1 留言对话列表

请求URL

GET
/chat

请求参数

  • 分页的一些字段
  • 请求头必须带上token

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @留言对话列表,按照最近的聊天对象排序的
  6. ],
  7. "page": {
  8. @分页
  9. }
  10. }
  11. }

3.6.2 发送留言

请求URL

POST
/chat

请求参数

  • content: [string] 消息内容,最大长度256【必填】
  • photo: [array] 留言图片,最多3张吧【必填】
  • type: [integer] 发起留言的用户类型,患者1、医生2【必填】
  • to_user_id: [integer] 发送对象的用户id【必填】

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @聊天信息,按照先后顺序依次排列
  6. ],
  7. }
  8. }

3.6.3 留言对话记录信息

请求URL

GET
/chat/{id}

请求参数

  • 分页的一些字段
  • id: 为下发会话对象中的id(chat_dialog表中的id)

响应

  1. {
  2. error_code: 0,
  3. data: {
  4. "list":[
  5. @聊天信息,按照先后顺序依次排列
  6. ],
  7. }
  8. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注