fix: mock接口停用参数校验
This commit is contained in:
parent
af54224504
commit
3eaba6004a
|
|
@ -3,8 +3,5 @@ package constants
|
||||||
type BotTools string
|
type BotTools string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
BotToolsBugOptimizationSubmit = "bug_optimization_submit" // 系统的bug/优化建议
|
BotToolsBugOptimizationSubmit = "bug_optimization_submit" // 系统的bug/优化建议
|
||||||
BotToolsAfterSalesSupplier = "after_sales_supplier" // 供应商售后
|
|
||||||
BotToolsAfterSalesResellerSingle = "after_sales_reseller_single" // 分销商单条售后
|
|
||||||
BotToolsAfterSalesResellerBatch = "after_sales_reseller_batch" // 分销商批量售后
|
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"ai_scheduler/internal/entitys"
|
"ai_scheduler/internal/entitys"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ZltxOrderAfterSaleResellerTool struct {
|
type ZltxOrderAfterSaleResellerTool struct {
|
||||||
|
|
@ -44,7 +43,7 @@ func (t *ZltxOrderAfterSaleResellerTool) Definition() entitys.ToolDefinition {
|
||||||
"description": "售后订单号",
|
"description": "售后订单号",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"required": []string{"orderType", "orderNumber"},
|
// "required": []string{"orderType", "orderNumber"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -92,9 +91,9 @@ func (t *ZltxOrderAfterSaleResellerTool) Execute(ctx context.Context, requireDat
|
||||||
if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil {
|
if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if req.OrderNumber == "" {
|
// if req.OrderNumber == "" {
|
||||||
return fmt.Errorf("orderType and orderNumber are required")
|
// return fmt.Errorf("orderType and orderNumber are required")
|
||||||
}
|
// }
|
||||||
return t.checkZltxOrderAfterSaleReseller(req.OrderNumber, requireData)
|
return t.checkZltxOrderAfterSaleReseller(req.OrderNumber, requireData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"ai_scheduler/internal/entitys"
|
"ai_scheduler/internal/entitys"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ZltxOrderAfterSaleSupplierTool struct {
|
type ZltxOrderAfterSaleSupplierTool struct {
|
||||||
|
|
@ -44,7 +43,7 @@ func (t *ZltxOrderAfterSaleSupplierTool) Definition() entitys.ToolDefinition {
|
||||||
"description": "售后订单号",
|
"description": "售后订单号",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"required": []string{"orderType", "orderNumber"},
|
// "required": []string{"orderType", "orderNumber"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -89,9 +88,9 @@ func (t *ZltxOrderAfterSaleSupplierTool) Execute(ctx context.Context, requireDat
|
||||||
if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil {
|
if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if req.OrderNumber == "" {
|
// if req.OrderNumber == "" {
|
||||||
return fmt.Errorf("orderType and orderNumber are required")
|
// return fmt.Errorf("orderType and orderNumber are required")
|
||||||
}
|
// }
|
||||||
return t.checkZltxOrderAfterSaleSupplier(req.OrderNumber, requireData)
|
return t.checkZltxOrderAfterSaleSupplier(req.OrderNumber, requireData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue