docs.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag
  3. package docs
  4. import (
  5. "bytes"
  6. "encoding/json"
  7. "strings"
  8. "github.com/alecthomas/template"
  9. "github.com/swaggo/swag"
  10. )
  11. var doc = `{
  12. "schemes": {{ marshal .Schemes }},
  13. "swagger": "2.0",
  14. "info": {
  15. "description": "{{.Description}}",
  16. "title": "{{.Title}}",
  17. "contact": {},
  18. "version": "{{.Version}}"
  19. },
  20. "host": "{{.Host}}",
  21. "basePath": "{{.BasePath}}",
  22. "paths": {
  23. "/Account/Login": {
  24. "post": {
  25. "consumes": [
  26. "application/json"
  27. ],
  28. "produces": [
  29. "application/json"
  30. ],
  31. "tags": [
  32. "账户服务"
  33. ],
  34. "summary": "账户登录",
  35. "parameters": [
  36. {
  37. "description": "登录入参",
  38. "name": "data",
  39. "in": "body",
  40. "required": true,
  41. "schema": {
  42. "$ref": "#/definitions/request.LoginReq"
  43. }
  44. }
  45. ],
  46. "responses": {
  47. "200": {
  48. "description": "返回包括用户信息,token,过期时间",
  49. "schema": {
  50. "allOf": [
  51. {
  52. "$ref": "#/definitions/response.Response"
  53. },
  54. {
  55. "type": "object",
  56. "properties": {
  57. "data": {
  58. "$ref": "#/definitions/response.LoginRsp"
  59. },
  60. "msg": {
  61. "type": "string"
  62. }
  63. }
  64. }
  65. ]
  66. }
  67. }
  68. }
  69. }
  70. }
  71. },
  72. "definitions": {
  73. "request.LoginReq": {
  74. "type": "object",
  75. "required": [
  76. "clientType",
  77. "password",
  78. "userName"
  79. ],
  80. "properties": {
  81. "clientType": {
  82. "description": "客户端类型,2-PC交易端 3-手机客户端_安卓 4-网页客户端 5-微信客户端 6-手机客户端_苹果",
  83. "type": "integer"
  84. },
  85. "password": {
  86. "description": "密码",
  87. "type": "string"
  88. },
  89. "userName": {
  90. "description": "用户名,可以是LoginID/LoginCode/手机号码",
  91. "type": "string"
  92. }
  93. }
  94. },
  95. "response.LoginRsp": {
  96. "type": "object",
  97. "properties": {
  98. "expiresAt": {
  99. "description": "过期时间",
  100. "type": "integer"
  101. },
  102. "loginId": {
  103. "description": "登录ID",
  104. "type": "integer"
  105. },
  106. "token": {
  107. "description": "新服务Token",
  108. "type": "string"
  109. },
  110. "userId": {
  111. "description": "用户ID",
  112. "type": "integer"
  113. }
  114. }
  115. },
  116. "response.Response": {
  117. "type": "object",
  118. "properties": {
  119. "code": {
  120. "type": "integer"
  121. },
  122. "data": {
  123. "type": "object"
  124. },
  125. "msg": {
  126. "type": "string"
  127. }
  128. }
  129. }
  130. },
  131. "securityDefinitions": {
  132. "ApiKeyAuth": {
  133. "type": "apiKey",
  134. "name": "x-token",
  135. "in": "header"
  136. }
  137. }
  138. }`
  139. type swaggerInfo struct {
  140. Version string
  141. Host string
  142. BasePath string
  143. Schemes []string
  144. Title string
  145. Description string
  146. }
  147. // SwaggerInfo holds exported Swagger Info so clients can modify it
  148. var SwaggerInfo = swaggerInfo{
  149. Version: "0.0.1",
  150. Host: "",
  151. BasePath: "/",
  152. Schemes: []string{},
  153. Title: "Swagger Example API",
  154. Description: "新接入服务",
  155. }
  156. type s struct{}
  157. func (s *s) ReadDoc() string {
  158. sInfo := SwaggerInfo
  159. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  160. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  161. "marshal": func(v interface{}) string {
  162. a, _ := json.Marshal(v)
  163. return string(a)
  164. },
  165. }).Parse(doc)
  166. if err != nil {
  167. return doc
  168. }
  169. var tpl bytes.Buffer
  170. if err := t.Execute(&tpl, sInfo); err != nil {
  171. return doc
  172. }
  173. return tpl.String()
  174. }
  175. func init() {
  176. swag.Register(swag.Name, &s{})
  177. }