| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-terms.yaml
- get:
- summary: '列出术语(dhamma term)'
- tags:
- - terms
- operationId: get_api_v2_terms
- description: |
- 各 view 的去向:
- - `channel` → `GET /v3/channels/{channel}/terms`
- - `studio` / `user` → `GET /v3/studios/{studio}/terms`(`{studio}` 一律 uuid;`general=true` 只要 studio 级术语)
- - `word` → `GET /v3/terms?word=`(只列看得见的;`with_body=true` 带渲染后的正文)
- - `create-by-channel` 不迁:v6 改为「按词查 + channel 详情」两次调用
- - `show`、`tag`、`hot-meaning` 没有消费者,不迁
- 保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
- parameters:
- -
- name: view
- in: query
- schema:
- type: string
- enum:
- - create-by-channel
- - studio
- - channel
- - show
- - user
- - word
- - tag
- - hot-meaning
- description: 查询口径
- required: true
- -
- name: channel
- in: query
- schema:
- type: string
- description: 'view=create-by-channel 时必填,目标 channel 的 uid, 用于确定语言、同 studio 的 channel 列表与 studio 信息'
- -
- name: word
- in: query
- schema:
- type: string
- description: 'view=create-by-channel 时为要新建的术语词形; view=word 时为逗号分隔的词或义项列表,按 word 或 meaning 命中'
- -
- name: name
- in: query
- schema:
- type: string
- description: 'view=studio 时必填,studio 名称,须与当前用户的 studio 一致'
- -
- name: id
- in: query
- schema:
- type: string
- description: 'view=channel 时为 channel id(uid);view=show 时为术语主键 id'
- -
- name: search
- in: query
- schema:
- type: string
- description: '关键字,按 word、word_en 前缀匹配或 meaning 模糊匹配'
- -
- name: tag
- in: query
- schema:
- type: string
- description: 'view=tag 时必填,逗号分隔的 tag 列表'
- -
- name: language
- in: query
- schema:
- type: string
- description: 'view=hot-meaning 时必填,统计该语言下每个词出现次数最多的义项'
- -
- name: order
- in: query
- schema:
- type: string
- default: updated_at
- description: 排序字段
- -
- name: dir
- in: query
- schema:
- type: string
- enum:
- - asc
- - desc
- default: desc
- description: 排序方向
- -
- name: offset
- in: query
- schema:
- type: integer
- default: 0
- description: 分页偏移量
- -
- name: limit
- in: query
- schema:
- type: integer
- default: 1000
- description: 每页条数
- -
- name: mode
- in: query
- schema:
- type: string
- default: read
- description: '渲染 note/summary 的模式,透传给 Markdown 渲染器'
- -
- name: format
- in: query
- schema:
- type: string
- enum:
- - react
- - html
- - text
- default: react
- description: 'note 的渲染输出格式'
- -
- name: community_summary
- in: query
- schema:
- type: boolean
- description: '传入该参数时,自身没有 note 的术语会回落到社区 channel 的解释作为 summary'
- -
- name: exp
- in: query
- schema:
- type: boolean
- description: 传入该参数时附带编辑者截至本条更新时间的累计经验值(秒)
- responses:
- 200:
- description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
- content:
- application/json:
- schema:
- type: object
- properties:
- ok:
- type: boolean
- message:
- type: string
- data:
- type: object
- properties:
- rows:
- type: array
- items:
- type: object
- properties: { id: { type: integer }, guid: { type: string }, word: { type: string }, word_en: { type: string }, meaning: { type: string }, other_meaning: { type: string }, tag: { type: string }, note: { type: string }, language: { type: string }, channel_id: { type: integer }, channal: { type: string }, studio: { type: string }, editor: { type: string }, created_at: { type: string }, updated_at: { type: string }, mode: { type: string }, format: { type: string }, studioId: { type: string }, channel: { type: string }, html: { type: string }, summary_is_community: { type: string }, summary: { type: string }, role: { type: string }, exp: { type: string } }
- count:
- type: integer
- 401:
- $ref: '../../main.yaml#/components/responses/Unauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ValidationError'
- deprecated: true
- post:
- summary: 新建术语
- tags:
- - terms
- operationId: post_api_v2_terms
- description: |
- 已被取代:带 channel 的 → `POST /v3/channels/{channel}/terms`;studio 级(不带 channel)→ `POST /v3/studios/{studio}/terms`。
- v3 的 AI 代写走 `X-Agent-Grant` 请求头,不再收 body 里的 `access_token`。保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- word:
- type: string
- description: '术语词形,同时用于生成 word_en'
- meaning:
- type: string
- description: 主要义项
- tag:
- type: string
- description: 标签,参与查重
- channel:
- type: string
- description: 'channel uid。给出则建 channel 级术语,否则建 studio 级术语'
- language:
- type: string
- description: '语言。仅 studio 级术语生效,channel 级会被 channel 语言覆盖'
- other_meaning:
- type: string
- description: 其他义项,逗号分隔
- note:
- type: string
- description: 术语解释,Markdown
- access_token:
- type: string
- description: 'channel access token,供 AI 模型等非 owner 身份验证 channel 编辑权'
- studioId:
- type: string
- description: 'studio 的 uuid,不传 channel 时必填(或改用 studioName)'
- studioName:
- type: string
- description: 'studio 名称,未给 studioId 时用它换取 studioId'
- required:
- - word
- - meaning
- 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
- guid:
- type: string
- word:
- type: string
- word_en:
- type: string
- meaning:
- type: string
- other_meaning:
- type: string
- tag:
- type: string
- note:
- type: string
- language:
- type: string
- channel_id:
- type: integer
- channal:
- type: string
- studio:
- type: string
- editor:
- type: string
- created_at:
- type: string
- updated_at:
- type: string
- mode:
- type: string
- format:
- type: string
- studioId:
- type: string
- channel:
- type: string
- html:
- type: string
- summary_is_community:
- type: string
- summary:
- type: string
- role:
- type: string
- exp:
- type: string
- 401:
- $ref: '../../main.yaml#/components/responses/Unauthorized'
- 422:
- $ref: '../../main.yaml#/components/responses/ValidationError'
- deprecated: true
|