swagger.json 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "contact": {}
  5. },
  6. "basePath": "/htapi",
  7. "paths": {
  8. "/auth/login": {
  9. "post": {
  10. "tags": [
  11. "auth"
  12. ],
  13. "summary": "小程序用户登录",
  14. "description": "用户通过微信小程序登录\n\u003cbr\u003e",
  15. "parameters": [
  16. {
  17. "in": "body",
  18. "name": "code",
  19. "description": "获取微信小程序code",
  20. "required": true,
  21. "schema": {
  22. "type": "string"
  23. },
  24. "type": "string"
  25. }
  26. ],
  27. "responses": {
  28. "200": {
  29. "description": "",
  30. "schema": {
  31. "$ref": "#/definitions/controllers.BaseResponse"
  32. }
  33. }
  34. }
  35. }
  36. },
  37. "/auth/sendCode": {
  38. "post": {
  39. "tags": [
  40. "auth"
  41. ],
  42. "summary": "获取手机验证码",
  43. "description": "用户发送手机验证码\n\u003cbr\u003e",
  44. "parameters": [
  45. {
  46. "in": "body",
  47. "name": "mobile",
  48. "description": "小程序手机验证码接口",
  49. "required": true,
  50. "schema": {
  51. "$ref": "#/definitions/SmsCodeReq"
  52. }
  53. }
  54. ],
  55. "responses": {
  56. "200": {
  57. "description": "",
  58. "schema": {
  59. "$ref": "#/definitions/controllers.BaseResponse"
  60. }
  61. }
  62. }
  63. }
  64. },
  65. "/user/": {
  66. "get": {
  67. "tags": [
  68. "user"
  69. ],
  70. "description": "get all Users\n\u003cbr\u003e",
  71. "operationId": "UserController.GetAll",
  72. "responses": {
  73. "200": {
  74. "description": "",
  75. "schema": {
  76. "$ref": "#/definitions/models.User"
  77. }
  78. }
  79. }
  80. }
  81. }
  82. },
  83. "definitions": {
  84. "SmsCodeReq": {
  85. "title": "SmsCodeReq",
  86. "type": "object"
  87. },
  88. "controllers.BaseResponse": {
  89. "title": "BaseResponse",
  90. "type": "object",
  91. "properties": {
  92. "Data": {
  93. "$ref": "#/definitions/controllers.interface"
  94. },
  95. "ErrCode": {
  96. "type": "integer",
  97. "format": "int64"
  98. },
  99. "ErrMsg": {
  100. "type": "string"
  101. },
  102. "Msg": {
  103. "type": "string"
  104. },
  105. "Ret": {
  106. "description": "返回状态码",
  107. "type": "integer",
  108. "format": "int64"
  109. },
  110. "Success": {
  111. "description": "true 执行成功,false 执行失败",
  112. "type": "boolean"
  113. }
  114. }
  115. },
  116. "controllers.interface": {
  117. "title": "interface",
  118. "type": "object"
  119. },
  120. "gorm.DeletedAt": {
  121. "title": "DeletedAt",
  122. "type": "object"
  123. },
  124. "gorm.Model": {
  125. "title": "Model",
  126. "type": "object",
  127. "properties": {
  128. "CreatedAt": {
  129. "type": "string",
  130. "format": "datetime"
  131. },
  132. "DeletedAt": {
  133. "$ref": "#/definitions/gorm.DeletedAt"
  134. },
  135. "ID": {
  136. "type": "integer",
  137. "format": "int32"
  138. },
  139. "UpdatedAt": {
  140. "type": "string",
  141. "format": "datetime"
  142. }
  143. }
  144. },
  145. "models.User": {
  146. "title": "User",
  147. "type": "object",
  148. "properties": {
  149. "Gender": {
  150. "type": "string"
  151. },
  152. "Mobile": {
  153. "type": "string"
  154. },
  155. "NickName": {
  156. "type": "string"
  157. },
  158. "OpenId": {
  159. "type": "string"
  160. },
  161. "Password": {
  162. "type": "string"
  163. },
  164. "Username": {
  165. "type": "string"
  166. }
  167. }
  168. }
  169. },
  170. "tags": [
  171. {
  172. "name": "user",
  173. "description": "Operations about Users\n"
  174. }
  175. ]
  176. }