| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475 |
- # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-terms-term.yaml
- get:
- summary: 术语详情
- tags:
- - terms
- operationId: get_api_v3_terms_term_
- description: |-
- 带渲染后的「摘要 + 正文」(`body`)。channel 里的术语跟 channel 的可见性,studio 级的谁都能看。
- 响应带 `ETag` 头(与 `etag` 字段相同),修改时放进 `If-Match`。
- 实现:`V3\TermController@show`
- security:
- - { }
- -
- bearerAuth: []
- parameters:
- -
- name: term
- in: path
- required: true
- schema:
- type: string
- description: '术语 id(guid)'
- -
- name: channels
- in: query
- schema:
- type: string
- description: '正文按这些 channel 解析(句子、术语),逗号分隔,最多 20 个;只认你看得见的,不给就用术语所在 channel'
- -
- name: mode
- in: query
- schema:
- type: string
- enum:
- - read
- - edit
- default: read
- description: 正文模式
- -
- name: format
- in: query
- schema:
- type: string
- enum:
- - tree
- - html
- default: tree
- description: '正文格式:tree 给节点树 `body`,html 给 HTML 字符串 `html`(WebView 显示用)'
- 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
- 403:
- description: '所在 channel 看不见'
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
- patch:
- summary: 改术语
- tags:
- - terms
- operationId: patch_api_v3_terms_term_
- description: |-
- 只改传了的字段;word / tag 不能改(要改就新建一条,把旧的 redirect 过去)。必须带请求头
- `If-Match`(取自详情的 `etag` / `ETag`):不带 428,这条在你编辑期间被改过 412(响应里给出最新的 `etag`)。
- 分类从 note 的 `{{category|…}}` 重新抽取。channel 里的术语跟 channel 的写权限,studio 级的要团队 editor 以上。
- 实现:`V3\TermController@update`
- security:
- -
- bearerAuth: []
- parameters:
- -
- name: term
- in: path
- required: true
- schema:
- type: string
- description: '术语 id(guid)'
- requestBody:
- required: false
- content:
- application/json:
- schema:
- type: object
- properties:
- 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
- redirect:
- type: string
- nullable: true
- description: '重定向到 word 或 word@tag'
- language:
- type: string
- description: '语言(只有 studio 级术语能改)'
- 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
- 401:
- $ref: '../../main.yaml#/components/responses/ProblemUnauthorized'
- 403:
- description: 不能修改
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 412:
- description: 这条在你编辑期间被改过
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- 422:
- $ref: '../../main.yaml#/components/responses/ProblemValidation'
- 428:
- description: '没带 If-Match'
- content:
- application/problem+json:
- schema:
- $ref: '../../main.yaml#/components/schemas/ProblemDetails'
- delete:
- summary: 删术语
- tags:
- - terms
- operationId: delete_api_v3_terms_term_
- description: |-
- 软删除,返回被删的术语。拥有者本人或团队 owner 能删;AI 模型不能删。
- 实现:`V3\TermController@destroy`
- security:
- -
- bearerAuth: []
- parameters:
- -
- name: term
- in: path
- required: true
- schema:
- type: string
- description: '术语 id(guid)'
- 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
- 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'
|