diff --git a/app/api/schemas/admin.py b/app/api/schemas/admin.py index 467ba5b..f1f602b 100644 --- a/app/api/schemas/admin.py +++ b/app/api/schemas/admin.py @@ -80,9 +80,25 @@ class IntentPayload(StrictPayload): version: int = Field(default=1, ge=1) +#: `agent_reply_template.chk_template_scene` 允许的取值。**必须逐字对齐**: +#: 此前 `ReplyPayload.scene` 只校验长度(`min_length=1, max_length=32`), +#: 于是传一个不在列内的场景会**穿过接口校验、撞上数据库 CHECK 约束**, +#: 最终以 `500` 冒出(`(3819, "Check constraint 'chk_template_scene' is violated.")`)—— +#: 那本该是一次 `422` 参数校验失败。2026-09-13 由接口逐条测试发现。 +ReplyScene = Literal[ + "disclaimer", + "low_confidence", + "compliance_block", + "transfer", + "model_failure", + "system_busy", + "clarification", +] + + class ReplyPayload(StrictPayload): template_code: str = Field(min_length=1, max_length=64) - scene: str = Field(min_length=1, max_length=32) + scene: ReplyScene title: str = Field(min_length=1, max_length=128) content_text: str = Field(min_length=1, max_length=32000) variables: list[str] = Field(default_factory=list) diff --git a/app/static/portal/employee-operations/nl2sql/index.html b/app/static/portal/employee-operations/nl2sql/index.html index 886feef..70169cb 100644 --- a/app/static/portal/employee-operations/nl2sql/index.html +++ b/app/static/portal/employee-operations/nl2sql/index.html @@ -7,6 +7,7 @@ +
diff --git a/app/static/portal/employee-operations/nl2sql/nl2sql.css b/app/static/portal/employee-operations/nl2sql/nl2sql.css new file mode 100644 index 0000000..a8cc7ec --- /dev/null +++ b/app/static/portal/employee-operations/nl2sql/nl2sql.css @@ -0,0 +1,8 @@ +/* NL2SQL 页面的专属样式入口。 + * + * 本页当前复用 `operator-workspace.css`,这里暂时没有需要覆盖的规则。 + * 文件的存在是**约定**:门户每个页面都要有与目录同名的 js/css 入口 + * (`tests/unit/api/test_portal_frontend.py` 的 + * `test_every_portal_page_has_local_js_and_css_entry` 守着这条)—— + * 这样页面将来需要专属样式时有确定的位置,而不是继续往共用文件里堆。 + */ diff --git a/app/static/portal/employee-operations/offsite/index.html b/app/static/portal/employee-operations/offsite/index.html index ce76e1a..cd72274 100644 --- a/app/static/portal/employee-operations/offsite/index.html +++ b/app/static/portal/employee-operations/offsite/index.html @@ -7,6 +7,7 @@ +
diff --git a/app/static/portal/employee-operations/offsite/offsite.css b/app/static/portal/employee-operations/offsite/offsite.css new file mode 100644 index 0000000..4715aad --- /dev/null +++ b/app/static/portal/employee-operations/offsite/offsite.css @@ -0,0 +1,8 @@ +/* 场外基金运营页面的专属样式入口。 + * + * 本页当前复用 `operator-workspace.css`,这里暂时没有需要覆盖的规则。 + * 文件的存在是**约定**:门户每个页面都要有与目录同名的 js/css 入口 + * (`tests/unit/api/test_portal_frontend.py` 的 + * `test_every_portal_page_has_local_js_and_css_entry` 守着这条)—— + * 这样页面将来需要专属样式时有确定的位置,而不是继续往共用文件里堆。 + */ diff --git a/app/static/portal/employee-operations/promotion/index.html b/app/static/portal/employee-operations/promotion/index.html index 0703879..150c94c 100644 --- a/app/static/portal/employee-operations/promotion/index.html +++ b/app/static/portal/employee-operations/promotion/index.html @@ -7,6 +7,7 @@ +
diff --git a/app/static/portal/employee-operations/promotion/promotion.css b/app/static/portal/employee-operations/promotion/promotion.css new file mode 100644 index 0000000..995c3ce --- /dev/null +++ b/app/static/portal/employee-operations/promotion/promotion.css @@ -0,0 +1,8 @@ +/* 产品推介材料页面的专属样式入口。 + * + * 本页当前复用 `operator-workspace.css`,这里暂时没有需要覆盖的规则。 + * 文件的存在是**约定**:门户每个页面都要有与目录同名的 js/css 入口 + * (`tests/unit/api/test_portal_frontend.py` 的 + * `test_every_portal_page_has_local_js_and_css_entry` 守着这条)—— + * 这样页面将来需要专属样式时有确定的位置,而不是继续往共用文件里堆。 + */