# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-userdict-userdict.yaml get: summary: 查询单条用户词典记录 tags: - userdict operationId: get_api_v2_userdict_userdict_ description: |- 按主键查找,不做登录与权限校验;查不到返回「没有查询到数据」。 实现:`UserDictController@show` parameters: - name: userdict in: path required: true schema: type: string description: '词条 id' 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' put: summary: 更新单条用户词典记录 tags: - userdict operationId: put_api_v2_userdict_userdict_ description: |- 把请求体中的全部字段直接写入该记录(未做字段白名单与权限校验)。 更新成功后同步刷新系统汇总词典 _SYS_USER_WBW_ 与该单词的 Redis 缓存 dict/user。 没有记录被更新时返回「没有查询到数据」。 实现:`UserDictController@update` parameters: - name: userdict in: path required: true schema: type: string description: '词条 id' requestBody: required: false content: application/json: schema: type: object properties: word: type: string description: 单词 type: type: string description: 词性 grammar: type: string description: 语法属性 parent: type: string description: 词根 mean: type: string description: 词义 factors: type: string description: 复合词拆分 factormean: type: string description: 复合词各部分词义 note: type: string description: 备注 confidence: type: integer description: 置信度 status: type: integer description: '状态,大于 5 表示公开到社区' language: type: string description: 语言代码 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: 更新单条用户词典记录 tags: - userdict operationId: patch_api_v2_userdict_userdict_ description: |- 把请求体中的全部字段直接写入该记录(未做字段白名单与权限校验)。 更新成功后同步刷新系统汇总词典 _SYS_USER_WBW_ 与该单词的 Redis 缓存 dict/user。 没有记录被更新时返回「没有查询到数据」。 实现:`UserDictController@update` parameters: - name: userdict in: path required: true schema: type: string description: '词条 id' requestBody: required: false content: application/json: schema: type: object properties: word: type: string description: 单词 type: type: string description: 词性 grammar: type: string description: 语法属性 parent: type: string description: 词根 mean: type: string description: 词义 factors: type: string description: 复合词拆分 factormean: type: string description: 复合词各部分词义 note: type: string description: 备注 confidence: type: integer description: 置信度 status: type: integer description: '状态,大于 5 表示公开到社区' language: type: string description: 语言代码 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: 删除用户词典记录(支持批量) tags: - userdict operationId: delete_api_v2_userdict_userdict_ description: |- 需要登录,未登录返回 403。传了查询参数 id(JSON 数组)时走批量分支,逐条只删除 creator_id 等于当前用户的记录,返回 [实际删除条数, 汇总表更新结果];否则删除路径参数指定的单条记录, 非本人创建返回 auth.failed。两种分支都会同步刷新 _SYS_USER_WBW_ 汇总与 Redis 缓存 dict/user。 实现:`UserDictController@destroy` parameters: - name: userdict in: path required: true schema: type: string description: '要删除的词条 id(未传查询参数 id 时使用)' - name: id in: query schema: type: string description: '要批量删除的词条 id 数组的 JSON 字符串' example: - '123' - '456' 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'