swagger.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. swagger: "2.0"
  2. info: {}
  3. basePath: /htapi
  4. paths:
  5. /auth/login:
  6. post:
  7. tags:
  8. - auth
  9. summary: 小程序用户登录
  10. description: |-
  11. 用户通过微信小程序登录
  12. <br>
  13. parameters:
  14. - in: body
  15. name: mobile
  16. description: 登录请求体
  17. required: true
  18. schema:
  19. $ref: '#/definitions/LoginReq'
  20. responses:
  21. "200":
  22. description: ""
  23. schema:
  24. $ref: '#/definitions/controllers.BaseResponse'
  25. /auth/sendCode:
  26. post:
  27. tags:
  28. - auth
  29. summary: 获取手机验证码
  30. description: |-
  31. 用户发送手机验证码
  32. <br>
  33. parameters:
  34. - in: body
  35. name: mobile
  36. description: 小程序手机验证码接口
  37. required: true
  38. schema:
  39. $ref: '#/definitions/SmsCodeReq'
  40. responses:
  41. "200":
  42. description: ""
  43. schema:
  44. $ref: '#/definitions/controllers.BaseResponse'
  45. /user/:
  46. get:
  47. tags:
  48. - user
  49. description: |-
  50. get all Users
  51. <br>
  52. operationId: UserController.GetAll
  53. responses:
  54. "200":
  55. description: ""
  56. schema:
  57. $ref: '#/definitions/models.User'
  58. definitions:
  59. LoginReq:
  60. title: LoginReq
  61. type: object
  62. SmsCodeReq:
  63. title: SmsCodeReq
  64. type: object
  65. controllers.BaseResponse:
  66. title: BaseResponse
  67. type: object
  68. properties:
  69. Data:
  70. $ref: '#/definitions/controllers.interface'
  71. ErrCode:
  72. type: integer
  73. format: int64
  74. ErrMsg:
  75. type: string
  76. Msg:
  77. type: string
  78. Ret:
  79. description: 返回状态码
  80. type: integer
  81. format: int64
  82. Success:
  83. description: true 执行成功,false 执行失败
  84. type: boolean
  85. controllers.interface:
  86. title: interface
  87. type: object
  88. models.User:
  89. title: User
  90. type: object
  91. tags:
  92. - name: user
  93. description: |
  94. Operations about Users