| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-project-project.yaml
- get:
- summary: 查看单个工程
- tags:
- - project
- operationId: get_api_v2_project_project_
- description: |-
- 通过路由模型绑定按工程 uid 取出工程并返回详情,工程不存在时返回 404。
- 该接口不做登录与权限校验,私有工程同样可被读取。
- 实现:`ProjectController@show`
- parameters:
- -
- name: project
- in: path
- required: true
- schema:
- type: string
- description: '工程 uid'
- responses:
- 200:
- description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
- content:
- application/json:
- schema:
- type: object
- properties:
- ok:
- type: boolean
- message:
- type: string
- data:
- type: object
- properties:
- id:
- type: integer
- title:
- type: string
- type:
- type: integer
- weight:
- type: string
- description:
- type: string
- executors_id:
- type: integer
- parent_id:
- type: integer
- parent:
- type: string
- path:
- type: string
- owner:
- type: string
- editor:
- type: string
- privacy:
- type: string
- created_at:
- type: string
- updated_at:
- type: string
- 401:
- $ref: '../../main.yaml#/components/responses/Unauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ValidationError'
- put:
- summary: 修改工程
- tags:
- - project
- operationId: put_api_v2_project_project_
- description: |-
- 整体覆盖式更新:title、description、parent_id、privacy 会无条件按请求体写入,
- 未传的字段会被置空,调用方需回传完整数据。必须登录(否则 401),
- 且只有工程拥有者本人可以修改,否则返回 403。
- 传入合法的 parent_id 时会按父工程重新计算 path。
- 实现:`ProjectController@update`
- parameters:
- -
- name: project
- in: path
- required: true
- schema:
- type: string
- description: '工程 uid'
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- title:
- type: string
- description: 工程标题
- description:
- type: string
- description: 工程描述
- parent_id:
- type: string
- description: '父工程 uid;为合法 uuid 时重算 path'
- privacy:
- type: string
- description: '隐私性:public 表示社区可见'
- enum:
- - private
- - public
- default: private
- required:
- - title
- responses:
- 200:
- description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
- content:
- application/json:
- schema:
- type: object
- properties:
- ok:
- type: boolean
- message:
- type: string
- data:
- type: object
- properties:
- id:
- type: integer
- title:
- type: string
- type:
- type: integer
- weight:
- type: string
- description:
- type: string
- executors_id:
- type: integer
- parent_id:
- type: integer
- parent:
- type: string
- path:
- type: string
- owner:
- type: string
- editor:
- type: string
- privacy:
- type: string
- created_at:
- type: string
- updated_at:
- type: string
- 401:
- $ref: '../../main.yaml#/components/responses/Unauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ValidationError'
- patch:
- summary: 修改工程
- tags:
- - project
- operationId: patch_api_v2_project_project_
- description: |-
- 整体覆盖式更新:title、description、parent_id、privacy 会无条件按请求体写入,
- 未传的字段会被置空,调用方需回传完整数据。必须登录(否则 401),
- 且只有工程拥有者本人可以修改,否则返回 403。
- 传入合法的 parent_id 时会按父工程重新计算 path。
- 实现:`ProjectController@update`
- parameters:
- -
- name: project
- in: path
- required: true
- schema:
- type: string
- description: '工程 uid'
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- title:
- type: string
- description: 工程标题
- description:
- type: string
- description: 工程描述
- parent_id:
- type: string
- description: '父工程 uid;为合法 uuid 时重算 path'
- privacy:
- type: string
- description: '隐私性:public 表示社区可见'
- enum:
- - private
- - public
- default: private
- required:
- - title
- responses:
- 200:
- description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
- content:
- application/json:
- schema:
- type: object
- properties:
- ok:
- type: boolean
- message:
- type: string
- data:
- type: object
- properties:
- id:
- type: integer
- title:
- type: string
- type:
- type: integer
- weight:
- type: string
- description:
- type: string
- executors_id:
- type: integer
- parent_id:
- type: integer
- parent:
- type: string
- path:
- type: string
- owner:
- type: string
- editor:
- type: string
- privacy:
- type: string
- created_at:
- type: string
- updated_at:
- type: string
- 401:
- $ref: '../../main.yaml#/components/responses/Unauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ValidationError'
- delete:
- summary: 删除工程
- tags:
- - project
- operationId: delete_api_v2_project_project_
- description: |-
- 尚未实现:方法体为空,不会删除任何数据,也不返回任何内容(响应为 200 空 body)。
- 实现:`ProjectController@destroy`
- parameters:
- -
- name: project
- in: path
- required: true
- schema:
- type: string
- description: '工程 uid'
- responses:
- 200:
- description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
- content:
- application/json:
- schema:
- type: object
- properties:
- ok:
- type: boolean
- message:
- type: string
- data:
- type: object
- 401:
- $ref: '../../main.yaml#/components/responses/Unauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ValidationError'
|