| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-channels-channel.yaml
- get:
- summary: 'channel 详情'
- tags:
- - channels
- operationId: get_api_v3_channels_channel_
- description: |-
- 公开的谁都能看;私有的只有拥有者、团队成员、被共享的人能看。带查看者的 `abilities`。
- 实现:`V3\ChannelController@show`
- security:
- - { }
- -
- bearerAuth: []
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- responses:
- 200:
- description: 成功
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- id:
- type: string
- name:
- type: string
- summary:
- type: string
- nullable: true
- type:
- type: string
- lang:
- type: string
- status:
- type: integer
- is_system:
- type: boolean
- source_type:
- type: string
- source_id:
- type: string
- nullable: true
- owner:
- type: object
- properties:
- kind: { type: string }
- id: { type: string }
- nickName: { type: string }
- realName: { type: string }
- avatar: { type: string, nullable: true }
- abilities:
- type: object
- properties:
- read: { type: boolean }
- write: { type: boolean }
- update: { type: boolean }
- delete: { type: boolean }
- progress:
- type: number
- nullable: true
- description: 仅在部分查询口径下返回。
- created_at:
- type: string
- updated_at:
- type: string
- 403:
- description: '私有 channel,且看不见'
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
- delete:
- summary: '删除 channel'
- tags:
- - channels
- operationId: delete_api_v3_channels_channel_
- description: |-
- 软删除,返回被删的 channel。个人 channel 由拥有者删,团队的只有团队 owner 能删。
- channel 下已有译文、术语或逐词时拒绝(409,`content` 列出有哪几类)。系统 channel 不能删。
- 实现:`V3\ChannelController@destroy`
- security:
- -
- bearerAuth: []
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- responses:
- 200:
- description: 成功
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- id:
- type: string
- name:
- type: string
- summary:
- type: string
- nullable: true
- type:
- type: string
- lang:
- type: string
- status:
- type: integer
- is_system:
- type: boolean
- source_type:
- type: string
- source_id:
- type: string
- nullable: true
- owner:
- type: object
- properties:
- kind: { type: string }
- id: { type: string }
- nickName: { type: string }
- realName: { type: string }
- avatar: { type: string, nullable: true }
- abilities:
- type: object
- properties:
- read: { type: boolean }
- write: { type: boolean }
- update: { type: boolean }
- delete: { type: boolean }
- progress:
- type: number
- nullable: true
- description: 仅在部分查询口径下返回。
- created_at:
- type: string
- updated_at:
- type: string
- 401:
- $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
- 403:
- description: 不能删除
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 409:
- description: 'channel 下还有内容'
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
- patch:
- summary: '改 channel 信息'
- tags:
- - channels
- operationId: patch_api_v3_channels_channel_
- description: |-
- 只改传了的字段。拥有者;团队的 channel 由团队 owner / manager / editor 改;共享权限 ≥30 也能改。
- 系统 channel 不能改。AI 模型不能改。
- 实现:`V3\ChannelController@update`
- security:
- -
- bearerAuth: []
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- requestBody:
- required: false
- content:
- application/json:
- schema:
- type: object
- properties:
- name:
- type: string
- description: '名字,最长 128;同一 studio 内不能重名'
- type:
- type: string
- description: 类型
- enum:
- - translation
- - nissaya
- - original
- - wbw
- - commentary
- - similar
- lang:
- type: string
- description: '语言,最长 16'
- summary:
- type: string
- description: '简介,最长 1024'
- status:
- type: integer
- description: '10 私有、20 公开不列出(拿到链接能看,不进任何公开列表)、30 公开'
- source_type:
- type: string
- description: 来源
- enum:
- - original
- - reprint
- - ai
- source_id:
- type: string
- description: '来源 id'
- config:
- type: object
- description: 配置
- responses:
- 200:
- description: 成功
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- id:
- type: string
- name:
- type: string
- summary:
- type: string
- nullable: true
- type:
- type: string
- lang:
- type: string
- status:
- type: integer
- is_system:
- type: boolean
- source_type:
- type: string
- source_id:
- type: string
- nullable: true
- owner:
- type: object
- properties:
- kind: { type: string }
- id: { type: string }
- nickName: { type: string }
- realName: { type: string }
- avatar: { type: string, nullable: true }
- abilities:
- type: object
- properties:
- read: { type: boolean }
- write: { type: boolean }
- update: { type: boolean }
- delete: { type: boolean }
- progress:
- type: number
- nullable: true
- description: 仅在部分查询口径下返回。
- created_at:
- type: string
- updated_at:
- type: string
- 401:
- $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
- 403:
- description: 不能修改
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
|