From 50195474e74d913dad32c6b46522ff5c1ab3e744 Mon Sep 17 00:00:00 2001 From: wuchao <1272174216@qq.com> Date: Wed, 24 Sep 2025 09:51:51 +0800 Subject: [PATCH] =?UTF-8?q?test(biz):=20=E6=B7=BB=E5=8A=A0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=B8=AD=E9=80=9A=E8=B7=AF=E7=94=B1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 Test_ZltxStatistics 测试函数- 验证 handleTask 处理中通订单统计逻辑 - 模拟订单诊断参数传递 - 测试通道数据接收与任务配置解析- 确保统计工具参数校验正确性 --- internal/biz/router_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/biz/router_test.go b/internal/biz/router_test.go index f0647f8..a1bf5c0 100644 --- a/internal/biz/router_test.go +++ b/internal/biz/router_test.go @@ -61,6 +61,14 @@ func Test_ProductLog(t *testing.T) { t.Log(err) } +func Test_ZltxStatistics(t *testing.T) { + routerBiz := in() + ch := make(chan entitys.ResponseData, 5) + defer close(ch) + err := routerBiz.handleTask(ch, nil, &entitys.Match{Index: "order_diagnosis", Parameters: `{"number":"15583730896"}`}, &model.AiTask{Config: `{"tool": "zltxOrderStatistics", "param": {"type": "object", "optional": [], "required": ["number"], "properties": {"number": {"type": "string", "description": "充值账号/分销商ID"}}}}`}) + t.Log(err) +} + func in() *AiRouterBiz { modDir, err := getModuleDir()