swagger.json 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "web框架 API 文档",
  5. "title": "web框架",
  6. "termsOfService": "http://swagger.io/terms/",
  7. "contact": {
  8. "name": "API Support",
  9. "url": "http://www.swagger.io/support",
  10. "email": "support@swagger.io"
  11. },
  12. "license": {
  13. "name": "Apache 2.0",
  14. "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
  15. },
  16. "version": "1.0"
  17. },
  18. "basePath": "/v1",
  19. "paths": {
  20. "/Auth/SignUp": {
  21. "post": {
  22. "description": "用户添加",
  23. "consumes": [
  24. "application/x-www-form-urlencoded"
  25. ],
  26. "produces": [
  27. "application/json"
  28. ],
  29. "tags": [
  30. "Auth"
  31. ],
  32. "summary": "用户添加",
  33. "parameters": [
  34. {
  35. "type": "string",
  36. "description": "用户名",
  37. "name": "userCode",
  38. "in": "formData",
  39. "required": true
  40. },
  41. {
  42. "type": "string",
  43. "description": "密码",
  44. "name": "password",
  45. "in": "formData",
  46. "required": true
  47. },
  48. {
  49. "type": "string",
  50. "description": "邮箱",
  51. "name": "email",
  52. "in": "formData"
  53. },
  54. {
  55. "type": "string",
  56. "description": "手机号",
  57. "name": "phone",
  58. "in": "formData"
  59. },
  60. {
  61. "type": "string",
  62. "description": "姓名",
  63. "name": "name",
  64. "in": "formData"
  65. }
  66. ],
  67. "responses": {
  68. "200": {
  69. "description": "OK",
  70. "schema": {
  71. "$ref": "#/definitions/controller.ResponseBase"
  72. }
  73. }
  74. }
  75. }
  76. }
  77. },
  78. "definitions": {
  79. "controller.ResponseBase": {
  80. "type": "object",
  81. "properties": {
  82. "code": {
  83. "type": "integer"
  84. },
  85. "memo": {
  86. "type": "string"
  87. }
  88. }
  89. }
  90. },
  91. "securityDefinitions": {
  92. "ApiKeyAuth": {
  93. "type": "apiKey",
  94. "name": "Authorization",
  95. "in": "header"
  96. },
  97. "BasicAuth": {
  98. "type": "basic"
  99. },
  100. "OAuth2AccessCode": {
  101. "type": "oauth2",
  102. "flow": "accessCode",
  103. "authorizationUrl": "https://example.com/oauth/authorize",
  104. "tokenUrl": "https://example.com/oauth/token",
  105. "scopes": {
  106. "admin": " Grants read and write access to administrative information"
  107. }
  108. },
  109. "OAuth2Application": {
  110. "type": "oauth2",
  111. "flow": "application",
  112. "tokenUrl": "https://example.com/oauth/token",
  113. "scopes": {
  114. "admin": " Grants read and write access to administrative information",
  115. "write": " Grants write access"
  116. }
  117. },
  118. "OAuth2Implicit": {
  119. "type": "oauth2",
  120. "flow": "implicit",
  121. "authorizationUrl": "https://example.com/oauth/authorize",
  122. "scopes": {
  123. "admin": " Grants read and write access to administrative information",
  124. "write": " Grants write access"
  125. }
  126. },
  127. "OAuth2Password": {
  128. "type": "oauth2",
  129. "flow": "password",
  130. "tokenUrl": "https://example.com/oauth/token",
  131. "scopes": {
  132. "admin": " Grants read and write access to administrative information",
  133. "read": " Grants read access",
  134. "write": " Grants write access"
  135. }
  136. }
  137. }
  138. }