-f单独处理,null不计费

This commit is contained in:
2026-01-15 15:30:39 +08:00
parent 1e2687522b
commit 96dfa3d758
4 changed files with 43 additions and 2 deletions

View File

@@ -46,10 +46,15 @@ func ProcessJRZQO6L7Request(ctx context.Context, params []byte, deps *processors
"city": null,
}
// 使用 WithSkipCode201Check 不跳过 201 错误检查,当 Code == "201" 时返回错误
ctx = zhicha.WithSkipCode201Check(ctx)
respData, err := deps.ZhichaService.CallAPI(ctx, "ZCI081", reqData)
if err != nil {
if errors.Is(err, zhicha.ErrDatasource) {
return nil, errors.Join(processors.ErrDatasource, err)
}
if errors.Is(err, zhicha.ErrNotFound) {
return nil, errors.Join(processors.ErrNotFound, err)
} else {
return nil, errors.Join(processors.ErrSystem, err)
}

View File

@@ -47,10 +47,15 @@ func ProcessJRZQO7L1Request(ctx context.Context, params []byte, deps *processors
"city": null,
}
// 使用 WithSkipCode201Check 不跳过 201 错误检查,当 Code == "201" 时返回错误
ctx = zhicha.WithSkipCode201Check(ctx)
respData, err := deps.ZhichaService.CallAPI(ctx, "ZCI080", reqData)
if err != nil {
if errors.Is(err, zhicha.ErrDatasource) {
return nil, errors.Join(processors.ErrDatasource, err)
}
if errors.Is(err, zhicha.ErrNotFound) {
return nil, errors.Join(processors.ErrNotFound, err)
} else {
return nil, errors.Join(processors.ErrSystem, err)
}

View File

@@ -42,16 +42,19 @@ func ProcessJRZQS7G0Request(ctx context.Context, params []byte, deps *processors
"phone": encryptedMobileNo,
"authorized": paramsDto.Authorized,
}
// 使用 WithSkipCode201Check 不跳过 201 错误检查,当 Code == "201" 时返回错误
ctx = zhicha.WithSkipCode201Check(ctx)
respData, err := deps.ZhichaService.CallAPI(ctx, "ZCI082", reqData)
if err != nil {
if errors.Is(err, zhicha.ErrDatasource) {
return nil, errors.Join(processors.ErrDatasource, err)
}
if errors.Is(err, zhicha.ErrNotFound) {
return nil, errors.Join(processors.ErrNotFound, err)
} else {
return nil, errors.Join(processors.ErrSystem, err)
}
}
// 将响应数据转换为JSON字节
respBytes, err := json.Marshal(respData)
if err != nil {