docs.go 7.6 KB

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