| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-channel-channel.yaml
- get:
- summary: '获取单个 channel'
- tags:
- - channel
- operationId: get_api_v2_channel_channel_
- description: |-
- 返回 channel 详情,附带所属 studio 与作者信息。
- 实现:`ChannelController@show`
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- responses:
- 200:
- description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
- content:
- application/json:
- schema:
- type: object
- properties:
- ok:
- type: boolean
- message:
- type: string
- data:
- type: object
- properties:
- uid:
- type: string
- name:
- type: string
- summary:
- type: string
- nullable: true
- lang:
- type: string
- type:
- type: string
- updated_at:
- type: string
- studio:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- realName: { type: string }
- studioName: { type: string }
- avatar: { type: string }
- 401:
- $ref: '../../main.yaml#/components/responses/Unauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ValidationError'
- put:
- summary: '整体更新 channel'
- tags:
- - channel
- operationId: put_api_v2_channel_channel_
- description: |-
- 覆盖式更新,未传的字段会被写成 null;只改部分字段请用 PATCH /channel。
- 系统 channel 不可修改;非 owner 需要 30 以上的协作权限。
- 实现:`ChannelController@update`
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- id:
- type: string
- name:
- type: string
- description: 'channel 名称'
- type:
- type: integer
- description: 'channel 类型'
- summary:
- type: string
- description: 简介
- lang:
- type: string
- description: 译文语言代码
- status:
- type: integer
- description: '状态。30 为全网公开'
- source_type:
- type: string
- description: 来源类型,传入才会更新
- source_id:
- type: string
- description: '来源 id,传入才会更新'
- required:
- - name
- - type
- - summary
- - lang
- - status
- 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'
- patch:
- summary: '整体更新 channel'
- tags:
- - channel
- operationId: patch_api_v2_channel_channel_
- description: |-
- 覆盖式更新,未传的字段会被写成 null;只改部分字段请用 PATCH /channel。
- 系统 channel 不可修改;非 owner 需要 30 以上的协作权限。
- 实现:`ChannelController@update`
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- id:
- type: string
- name:
- type: string
- description: 'channel 名称'
- type:
- type: integer
- description: 'channel 类型'
- summary:
- type: string
- description: 简介
- lang:
- type: string
- description: 译文语言代码
- status:
- type: integer
- description: '状态。30 为全网公开'
- source_type:
- type: string
- description: 来源类型,传入才会更新
- source_id:
- type: string
- description: '来源 id,传入才会更新'
- required:
- - name
- - type
- - summary
- - lang
- - status
- 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'
- delete:
- summary: '删除 channel'
- tags:
- - channel
- operationId: delete_api_v2_channel_channel_
- description: |-
- 只有 owner 可以删除。channel 下已有译文、术语或逐词解析数据时拒绝删除。
- 实现:`ChannelController@destroy`
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel 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'
|