docs.go 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag at
  3. // 2020-10-19 23:32:55.3852666 +0800 CST m=+0.208956401
  4. package docs
  5. import (
  6. "bytes"
  7. "encoding/json"
  8. "strings"
  9. "github.com/alecthomas/template"
  10. "github.com/swaggo/swag"
  11. )
  12. var doc = `{
  13. "schemes": {{ marshal .Schemes }},
  14. "swagger": "2.0",
  15. "info": {
  16. "description": "{{.Description}}",
  17. "title": "{{.Title}}",
  18. "contact": {},
  19. "license": {},
  20. "version": "{{.Version}}"
  21. },
  22. "host": "{{.Host}}",
  23. "basePath": "{{.BasePath}}",
  24. "paths": {
  25. "/check": {
  26. "post": {
  27. "consumes": [
  28. "multipart/form-data"
  29. ],
  30. "produces": [
  31. "application/json"
  32. ],
  33. "summary": "登陆验证接口",
  34. "parameters": [
  35. {
  36. "type": "string",
  37. "description": "用户名",
  38. "name": "username",
  39. "in": "formData",
  40. "required": true
  41. },
  42. {
  43. "type": "string",
  44. "description": "密码",
  45. "name": "password",
  46. "in": "formData",
  47. "required": true
  48. },
  49. {
  50. "type": "string",
  51. "description": "类型",
  52. "name": "type",
  53. "in": "formData",
  54. "required": true
  55. }
  56. ],
  57. "responses": {
  58. "200": {
  59. "description": "OK",
  60. "schema": {
  61. "$ref": "#/definitions/controller.Response"
  62. }
  63. }
  64. }
  65. }
  66. },
  67. "/message": {
  68. "post": {
  69. "consumes": [
  70. "multipart/form-data"
  71. ],
  72. "produces": [
  73. "application/json"
  74. ],
  75. "summary": "发送消息接口",
  76. "parameters": [
  77. {
  78. "type": "string",
  79. "description": "来源uid",
  80. "name": "from_id",
  81. "in": "formData",
  82. "required": true
  83. },
  84. {
  85. "type": "string",
  86. "description": "目标uid",
  87. "name": "to_id",
  88. "in": "formData",
  89. "required": true
  90. },
  91. {
  92. "type": "string",
  93. "description": "内容",
  94. "name": "content",
  95. "in": "formData",
  96. "required": true
  97. },
  98. {
  99. "type": "string",
  100. "description": "类型|kefu,visitor",
  101. "name": "type",
  102. "in": "formData",
  103. "required": true
  104. }
  105. ],
  106. "responses": {
  107. "200": {
  108. "description": "OK",
  109. "schema": {
  110. "$ref": "#/definitions/controller.Response"
  111. }
  112. }
  113. }
  114. }
  115. },
  116. "/messages": {
  117. "get": {
  118. "consumes": [
  119. "multipart/form-data"
  120. ],
  121. "produces": [
  122. "application/json"
  123. ],
  124. "summary": "获取访客聊天信息接口",
  125. "parameters": [
  126. {
  127. "type": "string",
  128. "description": "访客ID",
  129. "name": "visitorId",
  130. "in": "query",
  131. "required": true
  132. },
  133. {
  134. "type": "string",
  135. "description": "认证token",
  136. "name": "token",
  137. "in": "header",
  138. "required": true
  139. }
  140. ],
  141. "responses": {
  142. "200": {
  143. "description": "OK",
  144. "schema": {
  145. "$ref": "#/definitions/controller.Response"
  146. }
  147. }
  148. }
  149. }
  150. },
  151. "/visitors": {
  152. "get": {
  153. "consumes": [
  154. "multipart/form-data"
  155. ],
  156. "produces": [
  157. "application/json"
  158. ],
  159. "summary": "获取访客列表接口",
  160. "parameters": [
  161. {
  162. "type": "string",
  163. "description": "分页",
  164. "name": "page",
  165. "in": "query",
  166. "required": true
  167. },
  168. {
  169. "type": "string",
  170. "description": "认证token",
  171. "name": "token",
  172. "in": "header",
  173. "required": true
  174. }
  175. ],
  176. "responses": {
  177. "200": {
  178. "description": "OK",
  179. "schema": {
  180. "$ref": "#/definitions/controller.Response"
  181. }
  182. }
  183. }
  184. }
  185. },
  186. "/visitors_online": {
  187. "get": {
  188. "produces": [
  189. "application/json"
  190. ],
  191. "summary": "获取在线访客列表接口",
  192. "responses": {
  193. "200": {
  194. "description": "OK",
  195. "schema": {
  196. "$ref": "#/definitions/controller.Response"
  197. }
  198. }
  199. }
  200. }
  201. }
  202. },
  203. "definitions": {
  204. "controller.Response": {
  205. "type": "object",
  206. "properties": {
  207. "code": {
  208. "type": "integer"
  209. },
  210. "msg": {
  211. "type": "string"
  212. },
  213. "result": {
  214. "type": "object"
  215. }
  216. }
  217. }
  218. }
  219. }`
  220. type swaggerInfo struct {
  221. Version string
  222. Host string
  223. BasePath string
  224. Schemes []string
  225. Title string
  226. Description string
  227. }
  228. // SwaggerInfo holds exported Swagger Info so clients can modify it
  229. var SwaggerInfo = swaggerInfo{
  230. Version: "",
  231. Host: "",
  232. BasePath: "",
  233. Schemes: []string{},
  234. Title: "",
  235. Description: "",
  236. }
  237. type s struct{}
  238. func (s *s) ReadDoc() string {
  239. sInfo := SwaggerInfo
  240. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  241. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  242. "marshal": func(v interface{}) string {
  243. a, _ := json.Marshal(v)
  244. return string(a)
  245. },
  246. }).Parse(doc)
  247. if err != nil {
  248. return doc
  249. }
  250. var tpl bytes.Buffer
  251. if err := t.Execute(&tpl, sInfo); err != nil {
  252. return doc
  253. }
  254. return tpl.String()
  255. }
  256. func init() {
  257. swag.Register(swag.Name, &s{})
  258. }