| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-channels-channel-terms.yaml
- get:
- summary: 'channel 的术语列表'
- tags:
- - channels
- operationId: get_api_v3_channels_channel_terms
- description: |-
- 能读 channel 的人都能看。请求头 `Accept` 是
- `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` 时导出成 xlsx:整表(过滤同列表、不分页),
- 列为 id / word / tag / meaning / other_meaning / summary / note / quality / content_type / redirect / language /
- channel_id / etag,可改后用导入接口传回(取代 v2 `terms-export`)。
- 实现:`V3\ChannelTermController@index`
- security:
- - { }
- -
- bearerAuth: []
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- -
- name: per_page
- in: query
- schema:
- type: integer
- default: 20
- description: '每页条数,最大 200'
- -
- name: search
- in: query
- schema:
- type: string
- description: 按词、释义搜索
- -
- name: quality
- in: query
- schema:
- type: string
- enum:
- - featured
- - standard
- - draft
- - pending
- description: '质量;pending 含未评级的'
- -
- name: category
- in: query
- schema:
- type: string
- description: 百科分类
- -
- name: order
- in: query
- schema:
- type: string
- enum:
- - updated_at
- - created_at
- - word
- default: updated_at
- description: 排序字段
- -
- name: dir
- in: query
- schema:
- type: string
- enum:
- - asc
- - desc
- description: 排序方向
- -
- name: page
- in: query
- schema:
- type: integer
- description: 页码
- responses:
- 200:
- description: 成功
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- word:
- type: string
- tag:
- type: string
- nullable: true
- meaning:
- type: string
- other_meaning:
- type: string
- nullable: true
- language:
- type: string
- channel_id:
- type: string
- nullable: true
- channel:
- type: object
- properties: { id: { type: string }, name: { type: string } }
- nullable: true
- owner_id:
- type: string
- quality:
- type: string
- nullable: true
- content_type:
- type: string
- summary:
- type: string
- nullable: true
- note:
- type: string
- nullable: true
- redirect:
- type: string
- nullable: true
- categories:
- type: array
- items: { type: string }
- summary_text:
- type: string
- body:
- type: array
- items: { $ref: '../../main.yaml#/components/schemas/MarkupNode' }
- description: 仅在部分查询口径下返回。
- html:
- type: string
- description: 仅在部分查询口径下返回。
- editor:
- type: object
- properties: { id: { type: string }, nickName: { type: string }, userName: { type: string }, realName: { type: string }, sn: { type: integer }, avatar: { type: string }, roles: { type: array, items: { type: string } } }
- nullable: true
- co_editor:
- type: object
- properties: { id: { type: string }, nickName: { type: string }, userName: { type: string }, realName: { type: string }, sn: { type: integer }, avatar: { type: string }, roles: { type: array, items: { type: string } } }
- nullable: true
- etag:
- type: string
- abilities:
- type: object
- properties: { update: { type: boolean }, delete: { type: boolean } }
- created_at:
- type: string
- updated_at:
- type: string
- deleted_at:
- type: string
- nullable: true
- meta:
- $ref: '../../main.yaml#/components/schemas/PaginationMeta'
- 403:
- description: '私有 channel,且看不见'
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
- post:
- summary: '在 channel 里新建术语'
- tags:
- - channels
- operationId: post_api_v3_channels_channel_terms
- description: |-
- 能写 channel 内容的人(含团队 editor)。owner 与语言跟 channel。同一 channel 里 word@tag 唯一(409)。
- 分类写在 note 的 `{{category|…}}` 里。AI 模型凭 `X-Agent-Grant` 代写。
- 实现:`V3\ChannelTermController@store`
- security:
- -
- bearerAuth: []
- parameters:
- -
- name: channel
- in: path
- required: true
- schema:
- type: string
- description: 'channel uid'
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- word:
- type: string
- description: 巴利词,建立后不能改
- tag:
- type: string
- nullable: true
- description: '义项(同词多义时区分),不能含 @,建立后不能改'
- meaning:
- type: string
- description: 释义
- other_meaning:
- type: string
- nullable: true
- description: 其它释义
- note:
- type: string
- nullable: true
- description: 正文
- summary:
- type: string
- nullable: true
- description: '摘要,格式与 note 相同'
- quality:
- type: string
- nullable: true
- description: 质量
- enum:
- - featured
- - standard
- - draft
- - pending
- content_type:
- type: string
- description: 正文方言
- enum:
- - markdown
- - markdown-e2
- default: markdown-e2
- redirect:
- type: string
- nullable: true
- description: '重定向到 word 或 word@tag'
- required:
- - word
- - meaning
- responses:
- 200:
- description: 成功
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- id:
- type: string
- word:
- type: string
- tag:
- type: string
- nullable: true
- meaning:
- type: string
- other_meaning:
- type: string
- nullable: true
- language:
- type: string
- channel_id:
- type: string
- nullable: true
- channel:
- type: object
- properties:
- id: { type: string }
- name: { type: string }
- nullable: true
- owner_id:
- type: string
- quality:
- type: string
- nullable: true
- content_type:
- type: string
- summary:
- type: string
- nullable: true
- note:
- type: string
- nullable: true
- redirect:
- type: string
- nullable: true
- categories:
- type: array
- items:
- type: string
- summary_text:
- type: string
- body:
- type: array
- items:
- $ref: '../../main.yaml#/components/schemas/MarkupNode'
- description: 仅在部分查询口径下返回。
- html:
- type: string
- description: 仅在部分查询口径下返回。
- editor:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- co_editor:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- etag:
- type: string
- abilities:
- type: object
- properties:
- update: { type: boolean }
- delete: { type: boolean }
- created_at:
- type: string
- updated_at:
- type: string
- deleted_at:
- type: string
- nullable: true
- 201:
- description: 已新建
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- id:
- type: string
- word:
- type: string
- tag:
- type: string
- nullable: true
- meaning:
- type: string
- other_meaning:
- type: string
- nullable: true
- language:
- type: string
- channel_id:
- type: string
- nullable: true
- channel:
- type: object
- properties:
- id: { type: string }
- name: { type: string }
- nullable: true
- owner_id:
- type: string
- quality:
- type: string
- nullable: true
- content_type:
- type: string
- summary:
- type: string
- nullable: true
- note:
- type: string
- nullable: true
- redirect:
- type: string
- nullable: true
- categories:
- type: array
- items:
- type: string
- summary_text:
- type: string
- body:
- type: array
- items:
- $ref: '../../main.yaml#/components/schemas/MarkupNode'
- description: 仅在部分查询口径下返回。
- html:
- type: string
- description: 仅在部分查询口径下返回。
- editor:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- co_editor:
- type: object
- properties:
- id: { type: string }
- nickName: { type: string }
- userName: { type: string }
- realName: { type: string }
- sn: { type: integer }
- avatar: { type: string }
- roles: { type: array, items: { type: string } }
- nullable: true
- etag:
- type: string
- abilities:
- type: object
- properties:
- update: { type: boolean }
- delete: { type: boolean }
- created_at:
- type: string
- updated_at:
- type: string
- deleted_at:
- type: string
- nullable: true
- 401:
- $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
- 403:
- description: '不能写这个 channel'
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 409:
- description: '已有这个 word@tag'
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
|