v2-userdict-userdict.yaml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-userdict-userdict.yaml
  2. get:
  3. summary: 查询单条用户词典记录
  4. tags:
  5. - userdict
  6. operationId: get_api_v2_userdict_userdict_
  7. description: |-
  8. 按主键查找,不做登录与权限校验;查不到返回「没有查询到数据」。
  9. 实现:`UserDictController@show`
  10. parameters:
  11. -
  12. name: userdict
  13. in: path
  14. required: true
  15. schema:
  16. type: string
  17. description: '词条 id'
  18. responses:
  19. 200:
  20. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  21. content:
  22. application/json:
  23. schema:
  24. type: object
  25. properties:
  26. ok:
  27. type: boolean
  28. message:
  29. type: string
  30. data:
  31. type: object
  32. 401:
  33. $ref: '../../main.yaml#/components/responses/Unauthorized'
  34. 422:
  35. $ref: '../../main.yaml#/components/responses/ValidationError'
  36. put:
  37. summary: 更新单条用户词典记录
  38. tags:
  39. - userdict
  40. operationId: put_api_v2_userdict_userdict_
  41. description: |-
  42. 把请求体中的全部字段直接写入该记录(未做字段白名单与权限校验)。
  43. 更新成功后同步刷新系统汇总词典 _SYS_USER_WBW_ 与该单词的 Redis 缓存 dict/user。
  44. 没有记录被更新时返回「没有查询到数据」。
  45. 实现:`UserDictController@update`
  46. parameters:
  47. -
  48. name: userdict
  49. in: path
  50. required: true
  51. schema:
  52. type: string
  53. description: '词条 id'
  54. requestBody:
  55. required: false
  56. content:
  57. application/json:
  58. schema:
  59. type: object
  60. properties:
  61. word:
  62. type: string
  63. description: 单词
  64. type:
  65. type: string
  66. description: 词性
  67. grammar:
  68. type: string
  69. description: 语法属性
  70. parent:
  71. type: string
  72. description: 词根
  73. mean:
  74. type: string
  75. description: 词义
  76. factors:
  77. type: string
  78. description: 复合词拆分
  79. factormean:
  80. type: string
  81. description: 复合词各部分词义
  82. note:
  83. type: string
  84. description: 备注
  85. confidence:
  86. type: integer
  87. description: 置信度
  88. status:
  89. type: integer
  90. description: '状态,大于 5 表示公开到社区'
  91. language:
  92. type: string
  93. description: 语言代码
  94. responses:
  95. 200:
  96. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  97. content:
  98. application/json:
  99. schema:
  100. type: object
  101. properties:
  102. ok:
  103. type: boolean
  104. message:
  105. type: string
  106. data:
  107. type: object
  108. 401:
  109. $ref: '../../main.yaml#/components/responses/Unauthorized'
  110. 422:
  111. $ref: '../../main.yaml#/components/responses/ValidationError'
  112. patch:
  113. summary: 更新单条用户词典记录
  114. tags:
  115. - userdict
  116. operationId: patch_api_v2_userdict_userdict_
  117. description: |-
  118. 把请求体中的全部字段直接写入该记录(未做字段白名单与权限校验)。
  119. 更新成功后同步刷新系统汇总词典 _SYS_USER_WBW_ 与该单词的 Redis 缓存 dict/user。
  120. 没有记录被更新时返回「没有查询到数据」。
  121. 实现:`UserDictController@update`
  122. parameters:
  123. -
  124. name: userdict
  125. in: path
  126. required: true
  127. schema:
  128. type: string
  129. description: '词条 id'
  130. requestBody:
  131. required: false
  132. content:
  133. application/json:
  134. schema:
  135. type: object
  136. properties:
  137. word:
  138. type: string
  139. description: 单词
  140. type:
  141. type: string
  142. description: 词性
  143. grammar:
  144. type: string
  145. description: 语法属性
  146. parent:
  147. type: string
  148. description: 词根
  149. mean:
  150. type: string
  151. description: 词义
  152. factors:
  153. type: string
  154. description: 复合词拆分
  155. factormean:
  156. type: string
  157. description: 复合词各部分词义
  158. note:
  159. type: string
  160. description: 备注
  161. confidence:
  162. type: integer
  163. description: 置信度
  164. status:
  165. type: integer
  166. description: '状态,大于 5 表示公开到社区'
  167. language:
  168. type: string
  169. description: 语言代码
  170. responses:
  171. 200:
  172. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  173. content:
  174. application/json:
  175. schema:
  176. type: object
  177. properties:
  178. ok:
  179. type: boolean
  180. message:
  181. type: string
  182. data:
  183. type: object
  184. 401:
  185. $ref: '../../main.yaml#/components/responses/Unauthorized'
  186. 422:
  187. $ref: '../../main.yaml#/components/responses/ValidationError'
  188. delete:
  189. summary: 删除用户词典记录(支持批量)
  190. tags:
  191. - userdict
  192. operationId: delete_api_v2_userdict_userdict_
  193. description: |-
  194. 需要登录,未登录返回 403。传了查询参数 id(JSON 数组)时走批量分支,逐条只删除 creator_id
  195. 等于当前用户的记录,返回 [实际删除条数, 汇总表更新结果];否则删除路径参数指定的单条记录,
  196. 非本人创建返回 auth.failed。两种分支都会同步刷新 _SYS_USER_WBW_ 汇总与 Redis 缓存 dict/user。
  197. 实现:`UserDictController@destroy`
  198. parameters:
  199. -
  200. name: userdict
  201. in: path
  202. required: true
  203. schema:
  204. type: string
  205. description: '要删除的词条 id(未传查询参数 id 时使用)'
  206. -
  207. name: id
  208. in: query
  209. schema:
  210. type: string
  211. description: '要批量删除的词条 id 数组的 JSON 字符串'
  212. example:
  213. - '123'
  214. - '456'
  215. responses:
  216. 200:
  217. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  218. content:
  219. application/json:
  220. schema:
  221. type: object
  222. properties:
  223. ok:
  224. type: boolean
  225. message:
  226. type: string
  227. data:
  228. type: object
  229. 401:
  230. $ref: '../../main.yaml#/components/responses/Unauthorized'
  231. 422:
  232. $ref: '../../main.yaml#/components/responses/ValidationError'