From e82ecaf9f7f38afb627c5e499db28a2769e2e1c2 Mon Sep 17 00:00:00 2001 From: wuchao <1272174216@qq.com> Date: Tue, 23 Sep 2025 15:16:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(zltx=5Fproduct):=E4=BF=AE=E6=AD=A3=E5=95=86?= =?UTF-8?q?=E5=93=81=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整 BaseURL 拼接方式,避免多余斜杠- 修改 AuthProductInfo 字段类型为 any 以适应不同数据结构 - 增加请求参数映射,确保 keyword 查询正确传递 - 完善请求封装,支持分页和搜索参数传递 --- internal/biz/router_test.go | 2 +- internal/tools/zltx_product.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/biz/router_test.go b/internal/biz/router_test.go index 4a98dc1..f0647f8 100644 --- a/internal/biz/router_test.go +++ b/internal/biz/router_test.go @@ -57,7 +57,7 @@ func Test_ProductLog(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: `{"name":"优酷周卡","serial_number":"822979421979938817"}`}, &model.AiTask{Config: `{"tool": "zltxProduct", "param": {"type": "object", "optional": [], "required": ["order_number"], "properties": {"order_number": {"type": "string", "description": "订单编号/流水号"}}}}`}) + err := routerBiz.handleTask(ch, nil, &entitys.Match{Index: "order_diagnosis", Parameters: `{"id":"101","serial_number":"822979421979938817"}`}, &model.AiTask{Config: `{"tool": "zltxProduct", "param": {"type": "object", "optional": [], "required": ["order_number"], "properties": {"order_number": {"type": "string", "description": "订单编号/流水号"}}}}`}) t.Log(err) } diff --git a/internal/tools/zltx_product.go b/internal/tools/zltx_product.go index a6002b3..0bd3d80 100644 --- a/internal/tools/zltx_product.go +++ b/internal/tools/zltx_product.go @@ -143,7 +143,7 @@ func (z ZltxProductTool) getZltxProduct(channel chan entitys.ResponseData, c *we var Url string var params map[string]string if id != "" { - Url = fmt.Sprintf("%s%s", z.config.BaseURL, id) + Url = fmt.Sprintf("%s/%s", z.config.BaseURL, id) } else { Url = fmt.Sprintf("%s?keyword=%s&limit=10&page=1", z.config.BaseURL, name) params = map[string]string{