From 0644dccf2a2de9ad079b2db6fdb4cd79fae1ac9e Mon Sep 17 00:00:00 2001 From: opsx Date: Sat, 31 Oct 2026 18:08:59 +0000 Subject: [PATCH] =?UTF-8?q?test(routers):=20=E6=96=AD=E8=A8=80=E8=B7=9F?= =?UTF-8?q?=E4=B8=8A=E4=B8=8A=E6=B8=B8=E9=87=8D=E6=9E=84=E2=80=94=E2=80=94?= =?UTF-8?q?/ai/analyze=20=E6=94=B9=E4=B8=BA=20/ai/chat=EF=BC=8C=E8=A1=A5?= =?UTF-8?q?=20license=20=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 上游 fbbd3a3/6923a12 把整页 AIOps 改成浮窗助手: - 删除 POST /ai/analyze(整页结构化分析) - 新增 POST /ai/chat(助手对话,AdminAuth + RequirePro) - 新增 GET /system/license、POST /system/license/activate 路由回归测试仍在断言已删除的 /ai/analyze,导致 TestCriticalRoutes 失败。 本次按实际路由更新断言(这正是这个测试的价值:路由被删/改名时立刻暴露)。 注:services.RunAIAnalysis / CollectAISignals 现在没有任何调用方(死代码), 是否保留待确认——见 PR 讨论。 --- backend/routers/router_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/routers/router_test.go b/backend/routers/router_test.go index 7f048fe..2455b9f 100644 --- a/backend/routers/router_test.go +++ b/backend/routers/router_test.go @@ -55,7 +55,10 @@ func TestCriticalRoutes(t *testing.T) { {"GET", "/api/v1/ai/config"}, {"PUT", "/api/v1/ai/config"}, {"POST", "/api/v1/ai/config/test"}, - {"POST", "/api/v1/ai/analyze"}, + // 重构后:整页分析改为浮窗助手(POST /ai/chat,admin + Pro 闸门) + {"POST", "/api/v1/ai/chat"}, + {"GET", "/api/v1/system/license"}, + {"POST", "/api/v1/system/license/activate"}, {"GET", "/api/v1/ai/runs"}, {"GET", "/api/v1/ai/runs/:id"}, // 备份恢复接口已在上游被移除(commit f87fb4b),这里不再断言