swagger.yml 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. swagger: "2.0"
  2. info:
  3. title: sws xcx api doc
  4. description: |
  5. 圣卫士小程序API接口文档
  6. version: 1.0.0
  7. license:
  8. name: 领透科技
  9. basePath: /xcx
  10. paths:
  11. /api/device/binddevice:
  12. post:
  13. tags:
  14. - api/device
  15. description: |-
  16. 绑定设备
  17. <br>
  18. operationId: DeviceApiController.BindDevice
  19. parameters:
  20. - in: query
  21. name: qrcode
  22. description: 设备二维码
  23. required: true
  24. type: string
  25. responses:
  26. "200":
  27. description: success
  28. "500":
  29. description: error
  30. security:
  31. - token: []
  32. /api/device/getdevicedetail:
  33. get:
  34. tags:
  35. - api/device
  36. description: |-
  37. 根据设备ID获取设备详细信息
  38. <br>
  39. operationId: DeviceApiController.GetDeviceDetail
  40. parameters:
  41. - in: query
  42. name: deviceid
  43. description: 设备ID
  44. required: true
  45. type: integer
  46. format: int64
  47. responses:
  48. "200":
  49. description: success
  50. schema:
  51. $ref: '#/definitions/models.Device'
  52. "500":
  53. description: error
  54. security:
  55. - token: []
  56. /api/device/getmydevices:
  57. get:
  58. tags:
  59. - api/device
  60. description: |-
  61. 获取绑定的设备列表
  62. <br>
  63. operationId: DeviceApiController.GetMyDevices
  64. responses:
  65. "200":
  66. description: success
  67. schema:
  68. type: array
  69. items:
  70. $ref: '#/definitions/models.Device'
  71. "500":
  72. description: error
  73. security:
  74. - token: []
  75. /api/device/unbinddevice:
  76. post:
  77. tags:
  78. - api/device
  79. description: |-
  80. 解绑设备
  81. <br>
  82. operationId: DeviceApiController.UnBindDevice
  83. parameters:
  84. - in: query
  85. name: deviceid
  86. description: 设备ID
  87. required: true
  88. type: integer
  89. format: int64
  90. responses:
  91. "200":
  92. description: success
  93. "500":
  94. description: error
  95. security:
  96. - token: []
  97. /api/sysdic/getcheckitems:
  98. get:
  99. tags:
  100. - api/sysdic
  101. description: |-
  102. 获取检测项目列表
  103. <br>
  104. operationId: SysDicApiController.GetCheckItems
  105. responses:
  106. "200":
  107. description: success
  108. schema:
  109. type: array
  110. items:
  111. $ref: '#/definitions/models.CheckItem'
  112. "500":
  113. description: error
  114. /api/sysdic/getdevicetypes:
  115. get:
  116. tags:
  117. - api/sysdic
  118. description: |-
  119. 获取设备类型列表
  120. <br>
  121. operationId: SysDicApiController.GetDeviceTypes
  122. responses:
  123. "200":
  124. description: success
  125. schema:
  126. type: array
  127. items:
  128. $ref: '#/definitions/models.DicResp'
  129. "500":
  130. description: error
  131. /api/sysdic/getillness:
  132. get:
  133. tags:
  134. - api/sysdic
  135. description: |-
  136. 获取病情字典
  137. <br>
  138. operationId: SysDicApiController.GetIllness
  139. responses:
  140. "200":
  141. description: success
  142. schema:
  143. type: array
  144. items:
  145. $ref: '#/definitions/models.DicResp'
  146. "500":
  147. description: error
  148. /api/sysdic/getrenalstatus:
  149. get:
  150. tags:
  151. - api/sysdic
  152. description: |-
  153. 获取肾功能情况列表
  154. <br>
  155. operationId: SysDicApiController.GetRenalStatus
  156. responses:
  157. "200":
  158. description: success
  159. schema:
  160. type: array
  161. items:
  162. $ref: '#/definitions/models.DicResp'
  163. "500":
  164. description: error
  165. /api/user/gethealthprofile:
  166. get:
  167. tags:
  168. - api/user
  169. description: |-
  170. 获取健康档案
  171. <br>
  172. operationId: UserApiController.GetHealthProfile
  173. responses:
  174. "200":
  175. description: success
  176. schema:
  177. $ref: '#/definitions/models.HealthProfileResp'
  178. "500":
  179. description: error
  180. security:
  181. - token: []
  182. /api/user/getuserinfo:
  183. get:
  184. tags:
  185. - api/user
  186. description: |-
  187. 获取个人中心信息
  188. <br>
  189. operationId: UserApiController.GetUserInfo
  190. responses:
  191. "200":
  192. description: success
  193. schema:
  194. $ref: '#/definitions/models.UserInfoResp'
  195. "500":
  196. description: error
  197. security:
  198. - token: []
  199. /api/user/login:
  200. post:
  201. tags:
  202. - api/user
  203. description: |-
  204. 微信小程序登录
  205. <br>
  206. operationId: LoginApiController.WxXcxLogin
  207. parameters:
  208. - in: body
  209. name: body
  210. description: 小程序登录请求参数
  211. required: true
  212. schema:
  213. $ref: '#/definitions/models.WxXcxLoginReq'
  214. responses:
  215. "200":
  216. description: ""
  217. schema:
  218. $ref: '#/definitions/models.WxXcxLoginResp'
  219. "500":
  220. description: error
  221. /api/user/savehealthprofile:
  222. post:
  223. tags:
  224. - api/user
  225. description: |-
  226. 保存健康档案
  227. <br>
  228. operationId: UserApiController.SaveHealthProfile
  229. parameters:
  230. - in: body
  231. name: body
  232. description: 小程序登录请求参数
  233. required: true
  234. schema:
  235. $ref: '#/definitions/models.SaveHealthProfileReq'
  236. responses:
  237. "200":
  238. description: success
  239. "500":
  240. description: error
  241. security:
  242. - token: []
  243. /api/user/saveuserinfo:
  244. post:
  245. tags:
  246. - api/user
  247. description: |-
  248. 个人中心保存用户信息和透析病友信息
  249. <br>
  250. operationId: UserApiController.SaveUserInfo
  251. parameters:
  252. - in: body
  253. name: body
  254. description: 小程序登录请求参数
  255. required: true
  256. schema:
  257. $ref: '#/definitions/models.SaveUserInfoReq'
  258. responses:
  259. "200":
  260. description: success
  261. "500":
  262. description: error
  263. security:
  264. - token: []
  265. /api/user/updatephonebycode:
  266. post:
  267. tags:
  268. - api/user
  269. description: |-
  270. 获取小程序绑定的手机号码并更新到用户信息
  271. <br>
  272. operationId: UserApiController.UpdatePhoneByCode
  273. parameters:
  274. - in: body
  275. name: body
  276. description: 小程序登录请求参数
  277. required: true
  278. schema:
  279. $ref: '#/definitions/models.WxXcxLoginReq'
  280. responses:
  281. "200":
  282. description: success
  283. schema:
  284. $ref: '#/definitions/models.XcxUser'
  285. "500":
  286. description: error
  287. security:
  288. - token: []
  289. definitions:
  290. models.CheckItem:
  291. title: CheckItem
  292. type: object
  293. properties:
  294. check_item_number:
  295. description: 排序
  296. type: integer
  297. format: int64
  298. check_type:
  299. description: 检测类型(试纸类型)
  300. type: string
  301. ctime:
  302. description: 创建时间
  303. type: string
  304. format: datetime
  305. delete_flag:
  306. description: 删除标志
  307. type: integer
  308. format: int64
  309. details:
  310. description: 描述
  311. type: string
  312. device_type:
  313. description: 设备类型
  314. type: string
  315. id:
  316. description: 检测项目ID
  317. type: integer
  318. format: int64
  319. language:
  320. description: 'cn: 中文 en 英文'
  321. type: string
  322. mtime:
  323. description: '更新时间 '
  324. type: string
  325. format: datetime
  326. name_cn:
  327. description: 检测项目中文名
  328. type: string
  329. name_en:
  330. description: 检测项目英文名
  331. type: string
  332. reference_value:
  333. description: ' 参考值'
  334. type: string
  335. remark:
  336. description: 备注
  337. type: string
  338. scope_list:
  339. description: 范围value 值,type =1为正常、2及以上为异 常
  340. type: string
  341. text:
  342. description: 文本
  343. type: string
  344. unit:
  345. description: 单位
  346. type: string
  347. models.Device:
  348. title: Device
  349. type: object
  350. properties:
  351. batch_number:
  352. description: 批号
  353. type: integer
  354. format: int64
  355. ctime:
  356. description: 创建时间
  357. type: string
  358. format: datetime
  359. delete_flag:
  360. description: 删除标志
  361. type: integer
  362. format: int64
  363. device_name:
  364. description: 设备名称
  365. type: string
  366. device_type:
  367. description: 设备类型
  368. type: string
  369. emq_password:
  370. description: emq密码
  371. type: string
  372. id:
  373. description: 设备ID
  374. type: integer
  375. format: int64
  376. inform_type:
  377. description: 通知类型:0跳转小程序、1跳转网页 、默认跳转小程序
  378. type: integer
  379. format: int64
  380. language:
  381. description: 语言
  382. type: string
  383. mac:
  384. type: string
  385. mcu:
  386. type: string
  387. mcu_type:
  388. description: MCU芯片类型
  389. type: string
  390. mtime:
  391. description: '更新时间 '
  392. type: string
  393. format: datetime
  394. name:
  395. description: 设备名称
  396. type: string
  397. number:
  398. description: 序号
  399. type: integer
  400. format: int64
  401. oem_company:
  402. description: 厂商(0:自营 1:艾玛OEM)
  403. type: integer
  404. format: int64
  405. paper_check:
  406. description: 试纸检查状态
  407. type: integer
  408. format: int64
  409. production_date_number:
  410. description: 生产日期
  411. type: integer
  412. format: int64
  413. qr_code:
  414. type: string
  415. sensor_mode:
  416. description: 传感放大倍数
  417. type: string
  418. serialno:
  419. description: 设备编号
  420. type: string
  421. status:
  422. description: 状态(0:未分配 1:已分配 2:包装中 3:待出厂 6:废弃 99:已出厂 100:销售中 101:已售出)
  423. type: integer
  424. format: int64
  425. ver:
  426. description: 软件版本
  427. type: string
  428. wifi_ver:
  429. description: WIFI版本
  430. type: string
  431. models.DicResp:
  432. title: DicResp
  433. type: object
  434. properties:
  435. name:
  436. description: 字典名称
  437. type: string
  438. type:
  439. type: string
  440. value:
  441. description: 字典值
  442. type: integer
  443. format: int64
  444. models.HealthProfileResp:
  445. title: HealthProfileResp
  446. type: object
  447. properties:
  448. birthday:
  449. $ref: '#/definitions/models.Time'
  450. description: 生日
  451. blood_type:
  452. description: 血型
  453. type: string
  454. creatine_time:
  455. $ref: '#/definitions/models.Time'
  456. description: 肌酐检测时间
  457. creatinine:
  458. description: 血肌酐
  459. type: integer
  460. format: int64
  461. creatinine_unit:
  462. description: 肌酐单位(umol/L,mg/dl)
  463. type: string
  464. ctime:
  465. $ref: '#/definitions/models.Time'
  466. description: 创建时间
  467. gender:
  468. description: 性别(0:未知 1:男 2:女)
  469. type: integer
  470. format: int64
  471. height:
  472. description: 身高
  473. type: integer
  474. format: int64
  475. id:
  476. description: Primary Key ID
  477. type: integer
  478. format: int64
  479. illness_state:
  480. description: 病情
  481. type: string
  482. mtime:
  483. $ref: '#/definitions/models.Time'
  484. description: '更新时间 '
  485. renal_function_status:
  486. description: '肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'
  487. type: integer
  488. format: int64
  489. status:
  490. description: 状态(1:有效 0:无效 )
  491. type: integer
  492. format: int64
  493. urine_protein:
  494. description: 尿蛋白
  495. type: integer
  496. format: int64
  497. urine_protein_24h:
  498. description: 24小时尿蛋白
  499. type: integer
  500. format: int64
  501. urine_protein_24h_time:
  502. $ref: '#/definitions/models.Time'
  503. description: 24小时尿蛋白检测时间
  504. urine_protein_24h_unit:
  505. description: 24小时尿蛋白单位(g/24h,mg/24h)
  506. type: string
  507. urine_protein_time:
  508. $ref: '#/definitions/models.Time'
  509. description: 尿蛋白检测时间
  510. urine_protein_unit:
  511. description: 尿蛋白单位(g,mg)
  512. type: string
  513. weight:
  514. description: 体重
  515. type: integer
  516. format: int64
  517. models.SaveHealthProfileReq:
  518. title: SaveHealthProfileReq
  519. type: object
  520. properties:
  521. birthday:
  522. description: 生日 yyyy-MM-dd HH:mm:ss
  523. type: string
  524. blood_type:
  525. description: 血型
  526. type: string
  527. creatine_time:
  528. description: 肌酐检测时间 yyyy-MM-dd HH:mm:ss
  529. type: string
  530. creatinine:
  531. description: 血肌酐
  532. type: integer
  533. format: int64
  534. creatinine_unit:
  535. description: 肌酐单位(umol/L,mg/dl)
  536. type: string
  537. gender:
  538. description: 性别(0:未知 1:男 2:女)
  539. type: integer
  540. format: int64
  541. height:
  542. description: 身高
  543. type: integer
  544. format: int64
  545. illness_state:
  546. description: 病情
  547. type: string
  548. renal_function_status:
  549. description: '肾功能情况(0:未透析,1: 血液透析,2:腹膜透析,3:肾脏移植)'
  550. type: integer
  551. format: int64
  552. urine_protein:
  553. description: 尿蛋白
  554. type: integer
  555. format: int64
  556. urine_protein_24h:
  557. description: 24小时尿蛋白
  558. type: integer
  559. format: int64
  560. urine_protein_24h_time:
  561. description: 24小时尿蛋白检测时间 yyyy-MM-dd HH:mm:ss
  562. type: string
  563. urine_protein_24h_unit:
  564. description: 24小时尿蛋白单位(g/24h,mg/24h)
  565. type: string
  566. urine_protein_time:
  567. description: 尿蛋白检测时间 yyyy-MM-dd HH:mm:ss
  568. type: string
  569. urine_protein_unit:
  570. description: 尿蛋白单位(g,mg)
  571. type: string
  572. weight:
  573. description: 体重
  574. type: integer
  575. format: int64
  576. models.SaveUserInfoReq:
  577. title: SaveUserInfoReq
  578. type: object
  579. properties:
  580. avatar:
  581. description: 头像
  582. type: string
  583. email:
  584. description: 邮件
  585. type: string
  586. id_card:
  587. description: 身份证号
  588. type: string
  589. inpatient_reg_phone:
  590. description: 住院登记手机号
  591. type: string
  592. nick_name:
  593. description: 昵称
  594. type: string
  595. phone:
  596. description: 手机号码
  597. type: string
  598. real_name:
  599. description: 真实姓名
  600. type: string
  601. models.Time:
  602. title: Time
  603. type: object
  604. models.UserInfoResp:
  605. title: UserInfoResp
  606. type: object
  607. properties:
  608. avatar:
  609. description: 头像
  610. type: string
  611. ctime:
  612. $ref: '#/definitions/models.Time'
  613. description: 创建时间
  614. email:
  615. description: 邮件
  616. type: string
  617. id:
  618. description: Primary Key ID
  619. type: integer
  620. format: int64
  621. id_card:
  622. description: 身份证号
  623. type: string
  624. inpatient_reg_phone:
  625. description: 住院登记手机号
  626. type: string
  627. mtime:
  628. $ref: '#/definitions/models.Time'
  629. description: '更新时间 '
  630. nick_name:
  631. description: 昵称
  632. type: string
  633. open_id:
  634. description: OpenID
  635. type: string
  636. patient_id:
  637. type: integer
  638. format: int64
  639. phone:
  640. description: 手机号码
  641. type: string
  642. privacy_protocol_versions:
  643. description: 隐私政策版本
  644. type: integer
  645. format: int64
  646. real_name:
  647. description: 真实姓名
  648. type: string
  649. source:
  650. description: 用户来源
  651. type: string
  652. status:
  653. description: 状态(1:有效0:无效)
  654. type: integer
  655. format: int64
  656. union_id:
  657. description: unionid
  658. type: string
  659. user_org_id:
  660. type: integer
  661. format: int64
  662. models.WxXcxLoginReq:
  663. title: WxXcxLoginReq
  664. type: object
  665. properties:
  666. code:
  667. type: string
  668. models.WxXcxLoginResp:
  669. title: WxXcxLoginResp
  670. type: object
  671. properties:
  672. openid:
  673. type: string
  674. patient_id:
  675. type: integer
  676. format: int64
  677. token:
  678. type: string
  679. user_org_id:
  680. type: integer
  681. format: int64
  682. models.XcxUser:
  683. title: XcxUser
  684. type: object
  685. properties:
  686. avatar:
  687. description: 头像
  688. type: string
  689. ctime:
  690. description: 创建时间
  691. type: string
  692. format: datetime
  693. email:
  694. description: 邮件
  695. type: string
  696. id:
  697. description: Primary Key ID
  698. type: integer
  699. format: int64
  700. mtime:
  701. description: '更新时间 '
  702. type: string
  703. format: datetime
  704. nick_name:
  705. description: 昵称
  706. type: string
  707. open_id:
  708. description: OpenID
  709. type: string
  710. patient_id:
  711. type: integer
  712. format: int64
  713. phone:
  714. description: 手机号码
  715. type: string
  716. privacy_protocol_versions:
  717. description: 隐私政策版本
  718. type: integer
  719. format: int64
  720. role_type:
  721. description: 角色类型 0或空:普通 1:管理员 2:测试
  722. type: integer
  723. format: int64
  724. session_key:
  725. type: string
  726. source:
  727. description: 用户来源
  728. type: string
  729. status:
  730. description: 状态(1:有效 0: 无效)
  731. type: integer
  732. format: int64
  733. union_id:
  734. description: unionid
  735. type: string
  736. user_org_id:
  737. type: integer
  738. format: int64
  739. securityDefinitions:
  740. token:
  741. type: apiKey
  742. name: Authorization
  743. in: header