fix(card_sender): 优化飞鱼卡密重新下单逻辑及日志输出
- 修改请求提交失败错误信息为“重新下单提交卡密” - 在日志中增加解析后的响应数据打印 - 新增对“请勿重复提交卡号”提示的处理,避免重复提交错误 - 保持“频繁操作”错误时返回重新下单错误提示
This commit is contained in:
@@ -123,7 +123,7 @@ func (s *SendCardTaskTypeFlyFishV2) HandleSendCardTask(ctx context.Context, orde
|
||||
|
||||
queryRes, err := webClient.R().SetContext(ctx).Get(queryUrl.String())
|
||||
if err != nil {
|
||||
return errors.New("请求提交地址失败")
|
||||
return errors.New("重新下单提交卡密")
|
||||
}
|
||||
|
||||
//正则表达式匹配
|
||||
@@ -163,10 +163,13 @@ func (s *SendCardTaskTypeFlyFishV2) HandleSendCardTask(ctx context.Context, orde
|
||||
Message string `json:"message"`
|
||||
}{}
|
||||
err = json.Unmarshal(resp.Body(), &respData)
|
||||
otelTrace.Logger.WithContext(ctx).Info("飞鱼查询返回", zap.String("respRawData", resp.String()))
|
||||
otelTrace.Logger.WithContext(ctx).Info("飞鱼查询返回", zap.String("respRawData", resp.String()), zap.Any("respData", respData))
|
||||
if strings.Contains(respData.Message, "频繁操作") {
|
||||
return errors.New("重新下单提交卡密")
|
||||
}
|
||||
if strings.Contains(respData.Message, "请勿重复提交卡号") {
|
||||
return nil
|
||||
}
|
||||
if respData.Code != 1 {
|
||||
return errors.New(respData.Message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user