Ver código fonte

chore(openapi): 追平 discussion 的规格与前端类型

6e8ee88f4(type=commentary)与 915e1d360(批注 title 改非必填)只改了
控制器,没重跑生成器,规格和 schema.d.ts 一直停在旧状态。这里只是重新
生成,没有手改任何一行。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
visuddhinanda 3 semanas atrás
pai
commit
1197124dc7

+ 22 - 10
dashboard-v6/src/api/schema.d.ts

@@ -16267,7 +16267,7 @@ export interface operations {
                 /** @description 状态过滤;res_id 与 topic-by-user 口径支持逗号分隔多选 */
                 status?: "active" | "close";
                 /** @description 讨论类型 */
-                type?: "discussion" | "qa" | "help" | "note";
+                type?: "discussion" | "qa" | "help" | "note" | "commentary";
                 /** @description 资源类型,影响权限判断与学员提问聚合 */
                 res_type?: "sentence" | "wbw" | "article";
                 /** @description 课程 uid,配合 show_student 聚合学员提问 */
@@ -16357,11 +16357,11 @@ export interface operations {
                      * @default discussion
                      * @enum {string}
                      */
-                    type?: "discussion" | "qa" | "help" | "note";
+                    type?: "discussion" | "qa" | "help" | "note" | "commentary";
                     /** @description 模板 id */
                     tpl_id?: string;
-                    /** @description 标题(有 parent 时非必填) */
-                    title: string;
+                    /** @description 标题(可选) */
+                    title?: string;
                     /** @description 正文内容 */
                     content?: string;
                     /**
@@ -16733,7 +16733,7 @@ export interface operations {
                      * @description 讨论类型,仅在提交时更新
                      * @enum {string}
                      */
-                    type?: "discussion" | "qa" | "help" | "note";
+                    type?: "discussion" | "qa" | "help" | "note" | "commentary";
                     /** @description 锚点起始偏移,仅在提交时更新 */
                     pos_start?: number;
                     /** @description 锚点结束偏移,仅在提交时更新 */
@@ -16843,7 +16843,7 @@ export interface operations {
                      * @description 讨论类型,仅在提交时更新
                      * @enum {string}
                      */
-                    type?: "discussion" | "qa" | "help" | "note";
+                    type?: "discussion" | "qa" | "help" | "note" | "commentary";
                     /** @description 锚点起始偏移,仅在提交时更新 */
                     pos_start?: number;
                     /** @description 锚点结束偏移,仅在提交时更新 */
@@ -32257,7 +32257,10 @@ export interface operations {
             query: {
                 /**
                  * @description 要删除的词条 id 数组的 JSON 字符串
-                 * @example ["123","456"]
+                 * @example [
+                 *       "123",
+                 *       "456"
+                 *     ]
                  */
                 id: string;
             };
@@ -32374,7 +32377,10 @@ export interface operations {
             query?: {
                 /**
                  * @description 要批量删除的词条 id 数组的 JSON 字符串
-                 * @example ["123","456"]
+                 * @example [
+                 *       "123",
+                 *       "456"
+                 *     ]
                  */
                 id?: string;
             };
@@ -33983,12 +33989,18 @@ export interface operations {
                 tags?: string;
                 /**
                  * @description 页码标记
-                 * @example ["V3.81","M3.58"]
+                 * @example [
+                 *       "V3.81",
+                 *       "M3.58"
+                 *     ]
                  */
                 page_refs?: unknown[];
                 /**
                  * @description 关联 id
-                 * @example ["chapter_93-5","m.n. 38"]
+                 * @example [
+                 *       "chapter_93-5",
+                 *       "m.n. 38"
+                 *     ]
                  */
                 related_id?: unknown[];
                 /** @description 按作者或译者过滤 */

+ 2 - 0
openapi/public/assets/protocol/resources/auto/v2-discussion-discussion.yaml

@@ -126,6 +126,7 @@ put:
                 - qa
                 - help
                 - note
+                - commentary
             pos_start:
               type: integer
               description: 锚点起始偏移,仅在提交时更新
@@ -251,6 +252,7 @@ patch:
                 - qa
                 - help
                 - note
+                - commentary
             pos_start:
               type: integer
               description: 锚点起始偏移,仅在提交时更新

+ 3 - 2
openapi/public/assets/protocol/resources/auto/v2-discussion.yaml

@@ -54,6 +54,7 @@ get:
           - qa
           - help
           - note
+          - commentary
         default: discussion
       description: 讨论类型
     -
@@ -185,13 +186,14 @@ post:
                 - qa
                 - help
                 - note
+                - commentary
               default: discussion
             tpl_id:
               type: string
               description: '模板 id'
             title:
               type: string
-              description: '标题(有 parent 时非必填)'
+              description: 标题(可选)
             content:
               type: string
               description: 正文内容
@@ -221,7 +223,6 @@ post:
           required:
             - res_id
             - res_type
-            - title
   responses:
     200:
       description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'