You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

swagger.json 10 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "contact": {}
  5. },
  6. "paths": {
  7. "/api/v1/community/create": {
  8. "post": {
  9. "description": "Create a new community",
  10. "produces": [
  11. "application/json"
  12. ],
  13. "tags": [
  14. "community"
  15. ],
  16. "summary": "CreateCommunity",
  17. "parameters": [
  18. {
  19. "description": "Community",
  20. "name": "data",
  21. "in": "body",
  22. "required": true,
  23. "schema": {
  24. "$ref": "#/definitions/param.CommunityParams"
  25. }
  26. }
  27. ],
  28. "responses": {
  29. "200": {
  30. "description": "Success",
  31. "schema": {
  32. "allOf": [
  33. {
  34. "$ref": "#/definitions/response.Response"
  35. },
  36. {
  37. "type": "object",
  38. "properties": {
  39. "msg": {
  40. "type": "string"
  41. }
  42. }
  43. }
  44. ]
  45. }
  46. }
  47. }
  48. }
  49. },
  50. "/api/v1/email/code": {
  51. "post": {
  52. "description": "Use email to send verification code",
  53. "produces": [
  54. "application/json"
  55. ],
  56. "tags": [
  57. "mail"
  58. ],
  59. "summary": "SendCode",
  60. "parameters": [
  61. {
  62. "description": "Email address",
  63. "name": "data",
  64. "in": "body",
  65. "required": true,
  66. "schema": {
  67. "$ref": "#/definitions/param.SendToParams"
  68. }
  69. }
  70. ],
  71. "responses": {
  72. "200": {
  73. "description": "Success",
  74. "schema": {
  75. "allOf": [
  76. {
  77. "$ref": "#/definitions/response.Response"
  78. },
  79. {
  80. "type": "object",
  81. "properties": {
  82. "msg": {
  83. "type": "string"
  84. }
  85. }
  86. }
  87. ]
  88. }
  89. }
  90. }
  91. }
  92. },
  93. "/api/v1/openim/callback": {
  94. "post": {
  95. "description": "Support OpenIM callback",
  96. "produces": [
  97. "application/json"
  98. ],
  99. "tags": [
  100. "openim"
  101. ],
  102. "summary": "OpenIMCallback",
  103. "responses": {
  104. "200": {
  105. "description": "Success",
  106. "schema": {
  107. "allOf": [
  108. {
  109. "$ref": "#/definitions/response.Response"
  110. },
  111. {
  112. "type": "object",
  113. "properties": {
  114. "msg": {
  115. "type": "string"
  116. }
  117. }
  118. }
  119. ]
  120. }
  121. }
  122. }
  123. }
  124. },
  125. "/api/v1/register/admin": {
  126. "post": {
  127. "description": "Create a new admin",
  128. "produces": [
  129. "application/json"
  130. ],
  131. "tags": [
  132. "user"
  133. ],
  134. "summary": "AdminRegister",
  135. "parameters": [
  136. {
  137. "description": "RegisterAdminParams",
  138. "name": "data",
  139. "in": "body",
  140. "required": true,
  141. "schema": {
  142. "$ref": "#/definitions/param.RegisterAdminParams"
  143. }
  144. }
  145. ],
  146. "responses": {
  147. "200": {
  148. "description": "Success",
  149. "schema": {
  150. "allOf": [
  151. {
  152. "$ref": "#/definitions/response.Response"
  153. },
  154. {
  155. "type": "object",
  156. "properties": {
  157. "msg": {
  158. "type": "string"
  159. }
  160. }
  161. }
  162. ]
  163. }
  164. }
  165. }
  166. }
  167. },
  168. "/api/v1/register/staff": {
  169. "post": {
  170. "description": "Create a new staff",
  171. "produces": [
  172. "application/json"
  173. ],
  174. "tags": [
  175. "user"
  176. ],
  177. "summary": "StaffRegister",
  178. "parameters": [
  179. {
  180. "description": "RegisterStaffParams",
  181. "name": "data",
  182. "in": "body",
  183. "required": true,
  184. "schema": {
  185. "$ref": "#/definitions/param.RegisterStaffParams"
  186. }
  187. }
  188. ],
  189. "responses": {
  190. "200": {
  191. "description": "Success",
  192. "schema": {
  193. "allOf": [
  194. {
  195. "$ref": "#/definitions/response.Response"
  196. },
  197. {
  198. "type": "object",
  199. "properties": {
  200. "msg": {
  201. "type": "string"
  202. }
  203. }
  204. }
  205. ]
  206. }
  207. }
  208. }
  209. }
  210. }
  211. },
  212. "definitions": {
  213. "param.CommunityParams": {
  214. "type": "object",
  215. "required": [
  216. "avatar",
  217. "email",
  218. "name"
  219. ],
  220. "properties": {
  221. "avatar": {
  222. "type": "string"
  223. },
  224. "email": {
  225. "type": "string"
  226. },
  227. "name": {
  228. "type": "string"
  229. }
  230. }
  231. },
  232. "param.CreateUserParams": {
  233. "type": "object",
  234. "required": [
  235. "avatar",
  236. "email",
  237. "nickname",
  238. "password"
  239. ],
  240. "properties": {
  241. "avatar": {
  242. "type": "string"
  243. },
  244. "email": {
  245. "type": "string"
  246. },
  247. "nickname": {
  248. "type": "string"
  249. },
  250. "password": {
  251. "type": "string"
  252. }
  253. }
  254. },
  255. "param.RegisterAdminParams": {
  256. "type": "object",
  257. "required": [
  258. "code",
  259. "community_info",
  260. "user_info"
  261. ],
  262. "properties": {
  263. "code": {
  264. "type": "string"
  265. },
  266. "community_info": {
  267. "$ref": "#/definitions/param.CommunityParams"
  268. },
  269. "user_info": {
  270. "$ref": "#/definitions/param.CreateUserParams"
  271. }
  272. }
  273. },
  274. "param.RegisterStaffParams": {
  275. "type": "object",
  276. "required": [
  277. "community_id",
  278. "user_info"
  279. ],
  280. "properties": {
  281. "community_id": {
  282. "type": "integer"
  283. },
  284. "user_info": {
  285. "$ref": "#/definitions/param.CreateUserParams"
  286. }
  287. }
  288. },
  289. "param.SendToParams": {
  290. "type": "object",
  291. "required": [
  292. "email"
  293. ],
  294. "properties": {
  295. "email": {
  296. "type": "string"
  297. }
  298. }
  299. },
  300. "response.Response": {
  301. "type": "object",
  302. "properties": {
  303. "code": {
  304. "type": "integer"
  305. },
  306. "data": {},
  307. "msg": {
  308. "type": "string"
  309. }
  310. }
  311. }
  312. }
  313. }