Merge branch 'main' of http://1.117.67.95:3000/team/tyc-server-v2
This commit is contained in:
@@ -102,13 +102,21 @@ func (a *ApiRequestService) ProcessRequests(params []byte, productID int64, orde
|
||||
// 在原始 params 上附加 order_no,供异步车辆类接口自动生成回调地址使用
|
||||
var baseParams map[string]interface{}
|
||||
if err := json.Unmarshal(params, &baseParams); err != nil {
|
||||
logx.Errorf("解析查询参数失败, Params: %s, Error: %v", string(params), err)
|
||||
return nil, fmt.Errorf("解析查询参数失败: %w", err)
|
||||
}
|
||||
|
||||
// 参数转换:将 mobile 转换为 mobile_no
|
||||
if mobile, exists := baseParams["mobile"]; exists {
|
||||
baseParams["mobile_no"] = mobile
|
||||
}
|
||||
|
||||
if orderNo != "" {
|
||||
baseParams["order_no"] = orderNo
|
||||
}
|
||||
paramsWithOrder, err := json.Marshal(baseParams)
|
||||
if err != nil {
|
||||
logx.Errorf("序列化查询参数失败, Params: %s, Error: %v", string(params), err)
|
||||
return nil, fmt.Errorf("序列化查询参数失败: %w", err)
|
||||
}
|
||||
var (
|
||||
@@ -155,6 +163,9 @@ func (a *ApiRequestService) ProcessRequests(params []byte, productID int64, orde
|
||||
}
|
||||
}
|
||||
if preprocessErr != nil {
|
||||
// 在这里添加日志记录入参
|
||||
logx.Errorf("API请求处理器失败, ApiID: %s, Params: %s, Error: %v", feature.ApiId, string(paramsWithOrder), preprocessErr)
|
||||
|
||||
result.Timestamp = timestamp
|
||||
result.Error = preprocessErr.Error()
|
||||
result.Data = resp
|
||||
|
||||
Reference in New Issue
Block a user