docs.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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. "/api/chatroom/create": {
  24. "post": {
  25. "description": "创建聊天室",
  26. "consumes": [
  27. "application/json"
  28. ],
  29. "produces": [
  30. "application/json"
  31. ],
  32. "tags": [
  33. "房间管理"
  34. ],
  35. "summary": "创建聊天室",
  36. "parameters": [
  37. {
  38. "description": "创建聊天室请求body",
  39. "name": "body",
  40. "in": "body",
  41. "required": true,
  42. "schema": {
  43. "$ref": "#/definitions/models.CreateChatroomReq"
  44. }
  45. }
  46. ],
  47. "responses": {
  48. "200": {
  49. "description": "{\"code\":200, \"message\":\"success\"}",
  50. "schema": {
  51. "type": "string"
  52. }
  53. }
  54. }
  55. }
  56. },
  57. "/api/chatroom/delete": {
  58. "get": {
  59. "description": "删除聊天室",
  60. "consumes": [
  61. "application/json"
  62. ],
  63. "produces": [
  64. "application/json"
  65. ],
  66. "tags": [
  67. "房间管理"
  68. ],
  69. "summary": "删除聊天室",
  70. "parameters": [
  71. {
  72. "type": "string",
  73. "description": "用户ID",
  74. "name": "userId",
  75. "in": "query",
  76. "required": true
  77. },
  78. {
  79. "type": "string",
  80. "description": "房间ID",
  81. "name": "roomId",
  82. "in": "query",
  83. "required": true
  84. }
  85. ],
  86. "responses": {
  87. "200": {
  88. "description": "{\"code\":200, \"message\":\"success\"}",
  89. "schema": {
  90. "type": "string"
  91. }
  92. }
  93. }
  94. }
  95. },
  96. "/api/chatroom/detail": {
  97. "get": {
  98. "description": "获取房间详情",
  99. "consumes": [
  100. "application/json"
  101. ],
  102. "produces": [
  103. "application/json"
  104. ],
  105. "tags": [
  106. "房间操作"
  107. ],
  108. "summary": "获取房间详情",
  109. "parameters": [
  110. {
  111. "type": "string",
  112. "description": "房间id",
  113. "name": "room_id",
  114. "in": "query",
  115. "required": true
  116. }
  117. ],
  118. "responses": {
  119. "200": {
  120. "description": "{\"code\":200, \"message\":\"success\"}",
  121. "schema": {
  122. "type": "string"
  123. }
  124. }
  125. }
  126. }
  127. },
  128. "/api/chatroom/join": {
  129. "post": {
  130. "description": "加入房间",
  131. "consumes": [
  132. "application/json"
  133. ],
  134. "produces": [
  135. "application/json"
  136. ],
  137. "tags": [
  138. "房间管理"
  139. ],
  140. "summary": "加入房间",
  141. "parameters": [
  142. {
  143. "description": "加入房间请求body",
  144. "name": "body",
  145. "in": "body",
  146. "required": true,
  147. "schema": {
  148. "$ref": "#/definitions/models.JoinChatroomParam"
  149. }
  150. }
  151. ],
  152. "responses": {
  153. "200": {
  154. "description": "{\"code\":200, \"message\":\"success\"}",
  155. "schema": {
  156. "type": "string"
  157. }
  158. }
  159. }
  160. }
  161. },
  162. "/api/chatroom/joinCreate": {
  163. "post": {
  164. "description": "创建并加入房间",
  165. "consumes": [
  166. "application/json"
  167. ],
  168. "produces": [
  169. "application/json"
  170. ],
  171. "tags": [
  172. "房间管理"
  173. ],
  174. "summary": "创建并加入房间",
  175. "parameters": [
  176. {
  177. "description": "创建并加入房间请求body",
  178. "name": "body",
  179. "in": "body",
  180. "required": true,
  181. "schema": {
  182. "$ref": "#/definitions/models.JoinChatroomReq"
  183. }
  184. }
  185. ],
  186. "responses": {
  187. "200": {
  188. "description": "{\"code\":200, \"message\":\"success\"}",
  189. "schema": {
  190. "type": "string"
  191. }
  192. }
  193. }
  194. }
  195. },
  196. "/api/chatroom/leave": {
  197. "post": {
  198. "description": "离开房间",
  199. "consumes": [
  200. "application/json"
  201. ],
  202. "produces": [
  203. "application/json"
  204. ],
  205. "tags": [
  206. "房间管理"
  207. ],
  208. "summary": "离开房间",
  209. "parameters": [
  210. {
  211. "description": "离开房间请求body",
  212. "name": "body",
  213. "in": "body",
  214. "required": true,
  215. "schema": {
  216. "$ref": "#/definitions/models.LeaveChatroomParam"
  217. }
  218. }
  219. ],
  220. "responses": {
  221. "200": {
  222. "description": "{\"code\":200, \"message\":\"success\"}",
  223. "schema": {
  224. "type": "string"
  225. }
  226. }
  227. }
  228. }
  229. },
  230. "/api/chatroom/list": {
  231. "get": {
  232. "description": "获取聊天室列表",
  233. "consumes": [
  234. "application/json"
  235. ],
  236. "produces": [
  237. "application/json"
  238. ],
  239. "tags": [
  240. "房间管理"
  241. ],
  242. "summary": "获取聊天室列表",
  243. "parameters": [
  244. {
  245. "type": "string",
  246. "description": "用户ID",
  247. "name": "userId",
  248. "in": "query",
  249. "required": true
  250. }
  251. ],
  252. "responses": {
  253. "200": {
  254. "description": "{\"code\":200, \"message\":\"success\"}",
  255. "schema": {
  256. "type": "string"
  257. }
  258. }
  259. }
  260. }
  261. },
  262. "/api/message/deleteInteract": {
  263. "get": {
  264. "description": "互动删除",
  265. "produces": [
  266. "application/json"
  267. ],
  268. "tags": [
  269. "消息管理"
  270. ],
  271. "summary": "互动删除",
  272. "parameters": [
  273. {
  274. "type": "string",
  275. "description": "id",
  276. "name": "id",
  277. "in": "query",
  278. "required": true
  279. },
  280. {
  281. "type": "string",
  282. "description": "互动类型",
  283. "name": "int_type",
  284. "in": "query",
  285. "required": true
  286. }
  287. ],
  288. "responses": {
  289. "200": {
  290. "description": "{\"code\":200, \"message\":\"success\", \"data\":{}}",
  291. "schema": {
  292. "type": "string"
  293. }
  294. }
  295. }
  296. }
  297. },
  298. "/api/message/interact": {
  299. "get": {
  300. "description": "获取互动",
  301. "produces": [
  302. "application/json"
  303. ],
  304. "tags": [
  305. "消息管理"
  306. ],
  307. "summary": "获取互动",
  308. "parameters": [
  309. {
  310. "type": "string",
  311. "description": "用户id",
  312. "name": "userId",
  313. "in": "query",
  314. "required": true
  315. }
  316. ],
  317. "responses": {
  318. "200": {
  319. "description": "{\"code\":200, \"message\":\"success\", \"data\":{}}",
  320. "schema": {
  321. "type": "string"
  322. }
  323. }
  324. }
  325. }
  326. },
  327. "/api/message/notice": {
  328. "get": {
  329. "description": "获取公告",
  330. "produces": [
  331. "application/json"
  332. ],
  333. "tags": [
  334. "消息管理"
  335. ],
  336. "summary": "获取公告",
  337. "parameters": [
  338. {
  339. "type": "string",
  340. "description": "用户id",
  341. "name": "userId",
  342. "in": "query"
  343. }
  344. ],
  345. "responses": {
  346. "200": {
  347. "description": "{\"code\":200, \"message\":\"success\", \"data\":{}}",
  348. "schema": {
  349. "type": "string"
  350. }
  351. }
  352. }
  353. }
  354. },
  355. "/api/message/notice/read": {
  356. "post": {
  357. "description": "公告阅读",
  358. "produces": [
  359. "application/json"
  360. ],
  361. "tags": [
  362. "消息管理"
  363. ],
  364. "summary": "公告阅读",
  365. "parameters": [
  366. {
  367. "description": "阅读公告",
  368. "name": "body",
  369. "in": "body",
  370. "required": true,
  371. "schema": {
  372. "$ref": "#/definitions/models.NoticeReadReq"
  373. }
  374. }
  375. ],
  376. "responses": {
  377. "200": {
  378. "description": "{\"code\":200,\"message\":\"success\",\"data\":{}}",
  379. "schema": {
  380. "type": "string"
  381. }
  382. }
  383. }
  384. }
  385. },
  386. "/api/message/send": {
  387. "post": {
  388. "description": "发送消息",
  389. "consumes": [
  390. "application/json"
  391. ],
  392. "produces": [
  393. "application/json"
  394. ],
  395. "tags": [
  396. "消息管理"
  397. ],
  398. "summary": "发送消息",
  399. "parameters": [
  400. {
  401. "description": "发送请求body",
  402. "name": "body",
  403. "in": "body",
  404. "required": true,
  405. "schema": {
  406. "$ref": "#/definitions/models.MessageParam"
  407. }
  408. }
  409. ],
  410. "responses": {
  411. "200": {
  412. "description": "{\"code\":200, \"message\":\"success\"}",
  413. "schema": {
  414. "type": "string"
  415. }
  416. }
  417. }
  418. }
  419. },
  420. "/api/message/timeline": {
  421. "get": {
  422. "description": "获取历史消息记录",
  423. "produces": [
  424. "application/json"
  425. ],
  426. "tags": [
  427. "消息管理"
  428. ],
  429. "summary": "获取历史消息记录",
  430. "parameters": [
  431. {
  432. "type": "string",
  433. "description": "用户id",
  434. "name": "userId",
  435. "in": "query"
  436. },
  437. {
  438. "type": "string",
  439. "description": "房间id",
  440. "name": "roomId",
  441. "in": "query",
  442. "required": true
  443. },
  444. {
  445. "type": "integer",
  446. "description": "当前页",
  447. "name": "pageIndex",
  448. "in": "query",
  449. "required": true
  450. },
  451. {
  452. "type": "integer",
  453. "description": "每页数量",
  454. "name": "pageSize",
  455. "in": "query",
  456. "required": true
  457. }
  458. ],
  459. "responses": {
  460. "200": {
  461. "description": "{\"code\":200, \"message\":\"success\", \"data\":{}}",
  462. "schema": {
  463. "type": "string"
  464. }
  465. }
  466. }
  467. }
  468. }
  469. },
  470. "definitions": {
  471. "models.CreateChatroomReq": {
  472. "type": "object",
  473. "properties": {
  474. "bCreatorId": {
  475. "type": "string"
  476. },
  477. "creatorId": {
  478. "type": "string"
  479. },
  480. "userCount": {
  481. "type": "integer"
  482. }
  483. }
  484. },
  485. "models.JoinChatroomParam": {
  486. "type": "object",
  487. "properties": {
  488. "roomId": {
  489. "type": "string"
  490. },
  491. "userId": {
  492. "type": "string"
  493. }
  494. }
  495. },
  496. "models.JoinChatroomReq": {
  497. "type": "object",
  498. "properties": {
  499. "bCreatorId": {
  500. "type": "string"
  501. },
  502. "creatorId": {
  503. "type": "string"
  504. },
  505. "userCount": {
  506. "type": "integer"
  507. }
  508. }
  509. },
  510. "models.LeaveChatroomParam": {
  511. "type": "object",
  512. "properties": {
  513. "roomId": {
  514. "type": "string"
  515. },
  516. "userId": {
  517. "type": "string"
  518. }
  519. }
  520. },
  521. "models.MessageParam": {
  522. "type": "object",
  523. "properties": {
  524. "message": {
  525. "type": "string"
  526. },
  527. "messageType": {
  528. "type": "string"
  529. },
  530. "roomId": {
  531. "type": "string"
  532. },
  533. "userId": {
  534. "type": "string"
  535. }
  536. }
  537. },
  538. "models.NoticeReadReq": {
  539. "type": "object",
  540. "properties": {
  541. "app_id": {
  542. "type": "string"
  543. },
  544. "notice_id": {
  545. "type": "string"
  546. },
  547. "user_id": {
  548. "type": "string"
  549. }
  550. }
  551. }
  552. }
  553. }`
  554. type swaggerInfo struct {
  555. Version string
  556. Host string
  557. BasePath string
  558. Schemes []string
  559. Title string
  560. Description string
  561. }
  562. // SwaggerInfo holds exported Swagger Info so clients can modify it
  563. var SwaggerInfo = swaggerInfo{
  564. Version: "",
  565. Host: "",
  566. BasePath: "",
  567. Schemes: []string{},
  568. Title: "",
  569. Description: "",
  570. }
  571. type s struct{}
  572. func (s *s) ReadDoc() string {
  573. sInfo := SwaggerInfo
  574. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  575. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  576. "marshal": func(v interface{}) string {
  577. a, _ := json.Marshal(v)
  578. return string(a)
  579. },
  580. }).Parse(doc)
  581. if err != nil {
  582. return doc
  583. }
  584. var tpl bytes.Buffer
  585. if err := t.Execute(&tpl, sInfo); err != nil {
  586. return doc
  587. }
  588. return tpl.String()
  589. }
  590. func init() {
  591. swag.Register(swag.Name, &s{})
  592. }