swagger.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "go-common api",
  5. "description": "api",
  6. "version": "1.0",
  7. "contact": {
  8. "email": "lintanghui@bilibili.com"
  9. },
  10. "license": {
  11. "name": "Apache 2.0",
  12. "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
  13. }
  14. },
  15. "paths": {
  16. "/ep/admin/saga/v1/projects": {
  17. "get": {
  18. "operationId": "/ep/admin/saga/v1/projects",
  19. "responses": {
  20. "200": {
  21. "description": "服务成功响应内容",
  22. "schema": {
  23. "type": "object",
  24. "properties": {
  25. "code": {
  26. "description": "错误码描述",
  27. "type": "integer"
  28. },
  29. "data": {
  30. "$ref": "#/definitions/ProjectsResp",
  31. "type": "object"
  32. },
  33. "message": {
  34. "description": "错误码文本描述",
  35. "type": "string"
  36. },
  37. "ttl": {
  38. "description": "客户端限速时间",
  39. "type": "integer",
  40. "format": "int64"
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
  47. },
  48. "/ep/admin/saga/v1/projects/favorite": {
  49. "get": {
  50. "operationId": "/ep/admin/saga/v1/projects/favorite",
  51. "responses": {
  52. "200": {
  53. "description": "服务成功响应内容",
  54. "schema": {
  55. "type": "object",
  56. "properties": {
  57. "code": {
  58. "description": "错误码描述",
  59. "type": "integer"
  60. },
  61. "data": {
  62. "$ref": "#/definitions/FavoriteProjectsResp",
  63. "type": "object"
  64. },
  65. "message": {
  66. "description": "错误码文本描述",
  67. "type": "string"
  68. },
  69. "ttl": {
  70. "description": "客户端限速时间",
  71. "type": "integer",
  72. "format": "int64"
  73. }
  74. }
  75. }
  76. }
  77. }
  78. }
  79. },
  80. "/ep/admin/saga/v1/projects/favorite/edit": {
  81. "post": {
  82. "operationId": "/ep/admin/saga/v1/projects/favorite/edit",
  83. "parameters": [
  84. {
  85. "in": "query",
  86. "name": "proj_id",
  87. "required": true,
  88. "type": "integer",
  89. "format": "int64"
  90. },
  91. {
  92. "in": "query",
  93. "name": "star",
  94. "required": true,
  95. "type": "boolean"
  96. }
  97. ],
  98. "responses": {
  99. "200": {
  100. "description": "服务成功响应内容",
  101. "schema": {
  102. "type": "object",
  103. "properties": {
  104. "code": {
  105. "description": "错误码描述",
  106. "type": "integer"
  107. },
  108. "data": {
  109. "$ref": "#/definitions/EmptyResp",
  110. "type": "object"
  111. },
  112. "message": {
  113. "description": "错误码文本描述",
  114. "type": "string"
  115. },
  116. "ttl": {
  117. "description": "客户端限速时间",
  118. "type": "integer",
  119. "format": "int64"
  120. }
  121. }
  122. }
  123. }
  124. }
  125. }
  126. },
  127. "/ep/admin/saga/v1/tasks/project": {
  128. "get": {
  129. "operationId": "/ep/admin/saga/v1/tasks/project",
  130. "parameters": [
  131. {
  132. "in": "query",
  133. "name": "ProjID",
  134. "type": "integer",
  135. "format": "int64"
  136. },
  137. {
  138. "in": "query",
  139. "name": "Statuses",
  140. "description": "3 - running, 4 - waiting, 默认查运行中和等待的任务 默认值 3,4",
  141. "type": "array"
  142. }
  143. ],
  144. "responses": {
  145. "200": {
  146. "description": "服务成功响应内容",
  147. "schema": {
  148. "type": "object",
  149. "properties": {
  150. "code": {
  151. "description": "错误码描述",
  152. "type": "integer"
  153. },
  154. "data": {
  155. "$ref": "#/definitions/TasksResp",
  156. "type": "object"
  157. },
  158. "message": {
  159. "description": "错误码文本描述",
  160. "type": "string"
  161. },
  162. "ttl": {
  163. "description": "客户端限速时间",
  164. "type": "integer",
  165. "format": "int64"
  166. }
  167. }
  168. }
  169. }
  170. }
  171. }
  172. },
  173. "/ep/admin/saga/v1/tasks/simple": {
  174. "get": {
  175. "operationId": "/ep/admin/saga/v1/tasks/simple",
  176. "parameters": [
  177. {
  178. "in": "query",
  179. "name": "Statuses",
  180. "description": "3 - running, 4 - waiting, 默认查运行中和等待的任务 默认值 3,4",
  181. "type": "array"
  182. }
  183. ],
  184. "responses": {
  185. "200": {
  186. "description": "服务成功响应内容",
  187. "schema": {
  188. "type": "object",
  189. "properties": {
  190. "code": {
  191. "description": "错误码描述",
  192. "type": "integer"
  193. },
  194. "data": {
  195. "$ref": "#/definitions/SimpleTasksResp",
  196. "type": "object"
  197. },
  198. "message": {
  199. "description": "错误码文本描述",
  200. "type": "string"
  201. },
  202. "ttl": {
  203. "description": "客户端限速时间",
  204. "type": "integer",
  205. "format": "int64"
  206. }
  207. }
  208. }
  209. }
  210. }
  211. }
  212. },
  213. "/ep/admin/saga/v1/user": {
  214. "get": {
  215. "operationId": "/ep/admin/saga/v1/user",
  216. "responses": {
  217. "200": {
  218. "description": "服务成功响应内容",
  219. "schema": {
  220. "type": "object",
  221. "properties": {
  222. "code": {
  223. "description": "错误码描述",
  224. "type": "integer"
  225. },
  226. "data": {
  227. "$ref": "#/definitions/User",
  228. "type": "object"
  229. },
  230. "message": {
  231. "description": "错误码文本描述",
  232. "type": "string"
  233. },
  234. "ttl": {
  235. "description": "客户端限速时间",
  236. "type": "integer",
  237. "format": "int64"
  238. }
  239. }
  240. }
  241. }
  242. }
  243. }
  244. }
  245. },
  246. "definitions": {
  247. "EmptyResp": {
  248. "title": "EmptyResp",
  249. "description": "EmptyResp resp for response without data",
  250. "type": "object"
  251. },
  252. "FavoriteProjectsResp": {
  253. "title": "FavoriteProjectsResp",
  254. "description": "FavoriteProjectsResp resp for favorite projects",
  255. "type": "object",
  256. "properties": {
  257. "projects": {
  258. "type": "array",
  259. "items": {
  260. "$ref": "#/definitions/Project",
  261. "type": "object"
  262. }
  263. }
  264. }
  265. },
  266. "MyProject": {
  267. "title": "MyProject",
  268. "description": "MyProject mask as star",
  269. "required": [
  270. "is_star"
  271. ],
  272. "type": "object",
  273. "properties": {
  274. "is_star": {
  275. "type": "boolean"
  276. }
  277. }
  278. },
  279. "Project": {
  280. "title": "Project",
  281. "description": "Project def",
  282. "required": [
  283. "name",
  284. "description",
  285. "web_url",
  286. "avatar_url",
  287. "git_ssh_url",
  288. "git_http_url",
  289. "namespace",
  290. "visibility_level",
  291. "path_with_namespace",
  292. "default_branch",
  293. "homepage",
  294. "url",
  295. "ssh_url",
  296. "http_url"
  297. ],
  298. "type": "object",
  299. "properties": {
  300. "avatar_url": {
  301. "type": "string"
  302. },
  303. "default_branch": {
  304. "type": "string"
  305. },
  306. "description": {
  307. "type": "string"
  308. },
  309. "git_http_url": {
  310. "type": "string"
  311. },
  312. "git_ssh_url": {
  313. "type": "string"
  314. },
  315. "homepage": {
  316. "type": "string"
  317. },
  318. "http_url": {
  319. "type": "string"
  320. },
  321. "name": {
  322. "type": "string"
  323. },
  324. "namespace": {
  325. "type": "string"
  326. },
  327. "path_with_namespace": {
  328. "type": "string"
  329. },
  330. "ssh_url": {
  331. "type": "string"
  332. },
  333. "url": {
  334. "type": "string"
  335. },
  336. "visibility_level": {
  337. "type": "integer",
  338. "format": "int64"
  339. },
  340. "web_url": {
  341. "type": "string"
  342. }
  343. }
  344. },
  345. "ProjectsResp": {
  346. "title": "ProjectsResp",
  347. "description": "ProjectsResp resp for query projects with start mark",
  348. "required": [
  349. "projects"
  350. ],
  351. "type": "object",
  352. "properties": {
  353. "projects": {
  354. "type": "array",
  355. "items": {
  356. "$ref": "#/definitions/MyProject",
  357. "type": "object"
  358. }
  359. }
  360. }
  361. },
  362. "SimpleProject": {
  363. "title": "SimpleProject",
  364. "description": "SimpleProject with project id, project name and tasks",
  365. "required": [
  366. "proj_id",
  367. "proj_name",
  368. "tasks"
  369. ],
  370. "type": "object",
  371. "properties": {
  372. "proj_id": {
  373. "type": "integer",
  374. "format": "int64"
  375. },
  376. "proj_name": {
  377. "type": "string"
  378. },
  379. "tasks": {
  380. "type": "array",
  381. "items": {
  382. "$ref": "#/definitions/SimpleTask",
  383. "type": "object"
  384. }
  385. }
  386. }
  387. },
  388. "SimpleTasksResp": {
  389. "title": "SimpleTasksResp",
  390. "description": "SimpleTasksResp resp for simple tasks",
  391. "required": [
  392. "projects"
  393. ],
  394. "type": "object",
  395. "properties": {
  396. "projects": {
  397. "type": "array",
  398. "items": {
  399. "$ref": "#/definitions/SimpleProject",
  400. "type": "object"
  401. }
  402. }
  403. }
  404. },
  405. "Task": {
  406. "title": "Task",
  407. "description": "Task def",
  408. "type": "object",
  409. "properties": {
  410. "author": {
  411. "type": "string"
  412. },
  413. "event_type": {
  414. "type": "string"
  415. },
  416. "id": {
  417. "type": "integer",
  418. "format": "int64"
  419. },
  420. "mr_id": {
  421. "type": "integer",
  422. "format": "int64"
  423. },
  424. "proj_id": {
  425. "type": "integer",
  426. "format": "int64"
  427. },
  428. "source_branch": {
  429. "type": "string"
  430. },
  431. "status": {
  432. "type": "integer",
  433. "format": "int64"
  434. },
  435. "target_branch": {
  436. "type": "string"
  437. },
  438. "task_details": {
  439. "type": "string"
  440. },
  441. "title": {
  442. "type": "string"
  443. },
  444. "url": {
  445. "type": "string"
  446. }
  447. }
  448. },
  449. "TasksResp": {
  450. "title": "TasksResp",
  451. "description": "TasksResp resp for tasks",
  452. "type": "object",
  453. "properties": {
  454. "tasks": {
  455. "type": "array",
  456. "items": {
  457. "$ref": "#/definitions/Task",
  458. "type": "object"
  459. }
  460. }
  461. }
  462. },
  463. "User": {
  464. "title": "User",
  465. "description": "User def",
  466. "required": [
  467. "name",
  468. "username",
  469. "avatar_url"
  470. ],
  471. "type": "object",
  472. "properties": {
  473. "avatar_url": {
  474. "type": "string"
  475. },
  476. "name": {
  477. "type": "string"
  478. },
  479. "username": {
  480. "type": "string"
  481. }
  482. }
  483. }
  484. }
  485. }