fix(zltx): 修改订单统计工具中number字段类型为interface{}
This commit is contained in:
parent
37a8318814
commit
1db689bcd1
|
|
@ -5,3 +5,4 @@ docs
|
||||||
cmd/server/wire_gen.go
|
cmd/server/wire_gen.go
|
||||||
__debug*
|
__debug*
|
||||||
.bin/
|
.bin/
|
||||||
|
.idea/
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ func (z ZltxOrderStatisticsTool) Definition() entitys.ToolDefinition {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ZltxOrderStatisticsRequest struct {
|
type ZltxOrderStatisticsRequest struct {
|
||||||
Number string `json:"number"`
|
Number interface{} `json:"number"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (z ZltxOrderStatisticsTool) Execute(ctx context.Context, rec *entitys.Recognize) error {
|
func (z ZltxOrderStatisticsTool) Execute(ctx context.Context, rec *entitys.Recognize) error {
|
||||||
|
|
@ -53,7 +53,7 @@ func (z ZltxOrderStatisticsTool) Execute(ctx context.Context, rec *entitys.Recog
|
||||||
if err := json.Unmarshal([]byte(rec.Match.Parameters), &req); err != nil {
|
if err := json.Unmarshal([]byte(rec.Match.Parameters), &req); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if req.Number == "" {
|
if req.Number == nil {
|
||||||
return fmt.Errorf("number is required")
|
return fmt.Errorf("number is required")
|
||||||
}
|
}
|
||||||
return z.getZltxOrderStatistics(req.Number, rec)
|
return z.getZltxOrderStatistics(req.Number, rec)
|
||||||
|
|
@ -76,14 +76,13 @@ type ZltxOrderStatisticsData struct {
|
||||||
Total int `json:"total"`
|
Total int `json:"total"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (z ZltxOrderStatisticsTool) getZltxOrderStatistics(number string, rec *entitys.Recognize) error {
|
func (z ZltxOrderStatisticsTool) getZltxOrderStatistics(number interface{}, rec *entitys.Recognize) error {
|
||||||
ext, err := rec_extra.GetTaskRecExt(rec)
|
ext, err := rec_extra.GetTaskRecExt(rec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
//查询订单详情
|
//查询订单详情
|
||||||
|
url := fmt.Sprintf("%s%s", z.config.BaseURL, fmt.Sprintf("%v", number))
|
||||||
url := fmt.Sprintf("%s%s", z.config.BaseURL, number)
|
|
||||||
req := l_request.Request{
|
req := l_request.Request{
|
||||||
Url: url,
|
Url: url,
|
||||||
Headers: map[string]string{
|
Headers: map[string]string{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue