v2-project-project.yaml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-project-project.yaml
  2. get:
  3. summary: 查看单个工程
  4. tags:
  5. - project
  6. operationId: get_api_v2_project_project_
  7. description: |-
  8. 通过路由模型绑定按工程 uid 取出工程并返回详情,工程不存在时返回 404。
  9. 该接口不做登录与权限校验,私有工程同样可被读取。
  10. 实现:`ProjectController@show`
  11. parameters:
  12. -
  13. name: project
  14. in: path
  15. required: true
  16. schema:
  17. type: string
  18. description: '工程 uid'
  19. responses:
  20. 200:
  21. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  22. content:
  23. application/json:
  24. schema:
  25. type: object
  26. properties:
  27. ok:
  28. type: boolean
  29. message:
  30. type: string
  31. data:
  32. type: object
  33. properties:
  34. id:
  35. type: integer
  36. title:
  37. type: string
  38. type:
  39. type: integer
  40. weight:
  41. type: string
  42. description:
  43. type: string
  44. executors_id:
  45. type: integer
  46. parent_id:
  47. type: integer
  48. parent:
  49. type: string
  50. path:
  51. type: string
  52. owner:
  53. type: string
  54. editor:
  55. type: string
  56. privacy:
  57. type: string
  58. created_at:
  59. type: string
  60. updated_at:
  61. type: string
  62. 401:
  63. $ref: '../../main.yaml#/components/responses/Unauthorized'
  64. 422:
  65. $ref: '../../main.yaml#/components/responses/ValidationError'
  66. put:
  67. summary: 修改工程
  68. tags:
  69. - project
  70. operationId: put_api_v2_project_project_
  71. description: |-
  72. 整体覆盖式更新:title、description、parent_id、privacy 会无条件按请求体写入,
  73. 未传的字段会被置空,调用方需回传完整数据。必须登录(否则 401),
  74. 且只有工程拥有者本人可以修改,否则返回 403。
  75. 传入合法的 parent_id 时会按父工程重新计算 path。
  76. 实现:`ProjectController@update`
  77. parameters:
  78. -
  79. name: project
  80. in: path
  81. required: true
  82. schema:
  83. type: string
  84. description: '工程 uid'
  85. requestBody:
  86. required: true
  87. content:
  88. application/json:
  89. schema:
  90. type: object
  91. properties:
  92. title:
  93. type: string
  94. description: 工程标题
  95. description:
  96. type: string
  97. description: 工程描述
  98. parent_id:
  99. type: string
  100. description: '父工程 uid;为合法 uuid 时重算 path'
  101. privacy:
  102. type: string
  103. description: '隐私性:public 表示社区可见'
  104. enum:
  105. - private
  106. - public
  107. default: private
  108. required:
  109. - title
  110. responses:
  111. 200:
  112. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  113. content:
  114. application/json:
  115. schema:
  116. type: object
  117. properties:
  118. ok:
  119. type: boolean
  120. message:
  121. type: string
  122. data:
  123. type: object
  124. properties:
  125. id:
  126. type: integer
  127. title:
  128. type: string
  129. type:
  130. type: integer
  131. weight:
  132. type: string
  133. description:
  134. type: string
  135. executors_id:
  136. type: integer
  137. parent_id:
  138. type: integer
  139. parent:
  140. type: string
  141. path:
  142. type: string
  143. owner:
  144. type: string
  145. editor:
  146. type: string
  147. privacy:
  148. type: string
  149. created_at:
  150. type: string
  151. updated_at:
  152. type: string
  153. 401:
  154. $ref: '../../main.yaml#/components/responses/Unauthorized'
  155. 422:
  156. $ref: '../../main.yaml#/components/responses/ValidationError'
  157. patch:
  158. summary: 修改工程
  159. tags:
  160. - project
  161. operationId: patch_api_v2_project_project_
  162. description: |-
  163. 整体覆盖式更新:title、description、parent_id、privacy 会无条件按请求体写入,
  164. 未传的字段会被置空,调用方需回传完整数据。必须登录(否则 401),
  165. 且只有工程拥有者本人可以修改,否则返回 403。
  166. 传入合法的 parent_id 时会按父工程重新计算 path。
  167. 实现:`ProjectController@update`
  168. parameters:
  169. -
  170. name: project
  171. in: path
  172. required: true
  173. schema:
  174. type: string
  175. description: '工程 uid'
  176. requestBody:
  177. required: true
  178. content:
  179. application/json:
  180. schema:
  181. type: object
  182. properties:
  183. title:
  184. type: string
  185. description: 工程标题
  186. description:
  187. type: string
  188. description: 工程描述
  189. parent_id:
  190. type: string
  191. description: '父工程 uid;为合法 uuid 时重算 path'
  192. privacy:
  193. type: string
  194. description: '隐私性:public 表示社区可见'
  195. enum:
  196. - private
  197. - public
  198. default: private
  199. required:
  200. - title
  201. responses:
  202. 200:
  203. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  204. content:
  205. application/json:
  206. schema:
  207. type: object
  208. properties:
  209. ok:
  210. type: boolean
  211. message:
  212. type: string
  213. data:
  214. type: object
  215. properties:
  216. id:
  217. type: integer
  218. title:
  219. type: string
  220. type:
  221. type: integer
  222. weight:
  223. type: string
  224. description:
  225. type: string
  226. executors_id:
  227. type: integer
  228. parent_id:
  229. type: integer
  230. parent:
  231. type: string
  232. path:
  233. type: string
  234. owner:
  235. type: string
  236. editor:
  237. type: string
  238. privacy:
  239. type: string
  240. created_at:
  241. type: string
  242. updated_at:
  243. type: string
  244. 401:
  245. $ref: '../../main.yaml#/components/responses/Unauthorized'
  246. 422:
  247. $ref: '../../main.yaml#/components/responses/ValidationError'
  248. delete:
  249. summary: 删除工程
  250. tags:
  251. - project
  252. operationId: delete_api_v2_project_project_
  253. description: |-
  254. 尚未实现:方法体为空,不会删除任何数据,也不返回任何内容(响应为 200 空 body)。
  255. 实现:`ProjectController@destroy`
  256. parameters:
  257. -
  258. name: project
  259. in: path
  260. required: true
  261. schema:
  262. type: string
  263. description: '工程 uid'
  264. responses:
  265. 200:
  266. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  267. content:
  268. application/json:
  269. schema:
  270. type: object
  271. properties:
  272. ok:
  273. type: boolean
  274. message:
  275. type: string
  276. data:
  277. type: object
  278. 401:
  279. $ref: '../../main.yaml#/components/responses/Unauthorized'
  280. 422:
  281. $ref: '../../main.yaml#/components/responses/ValidationError'