fix(zltx_product):修正商品信息接口调用问题

- 调整 BaseURL 拼接方式,避免多余斜杠- 修改 AuthProductInfo 字段类型为 any 以适应不同数据结构
- 增加请求参数映射,确保 keyword 查询正确传递
- 完善请求封装,支持分页和搜索参数传递
This commit is contained in:
wuchao 2025-09-23 15:16:12 +08:00
parent 3818b3f6cf
commit e82ecaf9f7
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ func Test_ProductLog(t *testing.T) {
routerBiz := in() routerBiz := in()
ch := make(chan entitys.ResponseData, 5) ch := make(chan entitys.ResponseData, 5)
defer close(ch) 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) t.Log(err)
} }

View File

@ -143,7 +143,7 @@ func (z ZltxProductTool) getZltxProduct(channel chan entitys.ResponseData, c *we
var Url string var Url string
var params map[string]string var params map[string]string
if id != "" { if id != "" {
Url = fmt.Sprintf("%s%s", z.config.BaseURL, id) Url = fmt.Sprintf("%s/%s", z.config.BaseURL, id)
} else { } else {
Url = fmt.Sprintf("%s?keyword=%s&limit=10&page=1", z.config.BaseURL, name) Url = fmt.Sprintf("%s?keyword=%s&limit=10&page=1", z.config.BaseURL, name)
params = map[string]string{ params = map[string]string{