f
This commit is contained in:
@@ -8,9 +8,6 @@ import (
|
||||
"tyapi-server/internal/domains/api/dto"
|
||||
"tyapi-server/internal/domains/api/services/processors"
|
||||
"tyapi-server/internal/infrastructure/external/shumai"
|
||||
"tyapi-server/internal/shared/logger"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// ProcessIVYZX5Q2Request IVYZX5Q2 活体识别步骤二API处理方法
|
||||
@@ -47,16 +44,13 @@ func ProcessIVYZX5Q2Request(ctx context.Context, params []byte, deps *processors
|
||||
}
|
||||
}
|
||||
|
||||
// result==2 时手动抛出错误(不通过/无记录,不返回正常响应)
|
||||
// result: 0-通过 1-不通过(0/1 正常返回并扣费);2-未找到结果(返回 codeDesc,不扣费)
|
||||
var body struct {
|
||||
Result int `json:"result"`
|
||||
Result int `json:"result"`
|
||||
CodeDesc string `json:"codeDesc"`
|
||||
}
|
||||
if err := json.Unmarshal(respBytes, &body); err == nil && body.Result == 2 {
|
||||
log := logger.GetGlobalLogger()
|
||||
log.Warn("IVYZX5Q2 活体检测 result=2 无记录或不通过,返回错误",
|
||||
zap.Int("result", body.Result),
|
||||
zap.ByteString("response", respBytes))
|
||||
return nil, errors.Join(processors.ErrNotFound, errors.New("活体检测 result=2 无记录或不通过"))
|
||||
return nil, &processors.SuccessNoBillError{Response: respBytes}
|
||||
}
|
||||
|
||||
return respBytes, nil
|
||||
|
||||
Reference in New Issue
Block a user