f
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"hyapi-server/internal/domains/api/dto"
|
||||
"hyapi-server/internal/domains/api/services/processors"
|
||||
"hyapi-server/internal/infrastructure/external/huibo"
|
||||
)
|
||||
|
||||
// ProcessFLXGHB4FRequest FLXGHB4F API处理方法 - 个人涉诉案件查询汇博
|
||||
@@ -38,27 +37,5 @@ func ProcessFLXGHB4FRequest(ctx context.Context, params []byte, deps *processors
|
||||
if err != nil {
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
|
||||
// 解析响应
|
||||
var response huibo.CallAPI2Response
|
||||
if err := json.Unmarshal(respBytes, &response); err != nil {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
// 处理状态码
|
||||
switch response.Code {
|
||||
case huibo.CallAPI2StatusSuccess:
|
||||
// 查询成功
|
||||
if response.Data == nil {
|
||||
return []byte("{}"), nil
|
||||
}
|
||||
return respBytes, nil
|
||||
case huibo.CallAPI2StatusNoData:
|
||||
// 查询成功,无数据 - 按产品约定按调用成功计费
|
||||
return []byte("{}"), nil
|
||||
default:
|
||||
// 其他错误状态码
|
||||
message := huibo.GetCallAPI2StatusMessage(response.Code)
|
||||
return nil, errors.Join(processors.ErrDatasource, errors.New(message))
|
||||
}
|
||||
return respBytes, nil
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
|
||||
"hyapi-server/internal/domains/api/dto"
|
||||
"hyapi-server/internal/domains/api/services/processors"
|
||||
"hyapi-server/internal/infrastructure/external/huibo"
|
||||
)
|
||||
|
||||
// ProcessQYGLBH7YRequest QYGLBH7Y API处理方法 - 企业案件查询汇博
|
||||
@@ -33,27 +32,5 @@ func ProcessQYGLBH7YRequest(ctx context.Context, params []byte, deps *processors
|
||||
if err != nil {
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
|
||||
// 解析响应
|
||||
var response huibo.CallAPI2Response
|
||||
if err := json.Unmarshal(respBytes, &response); err != nil {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
// 处理状态码
|
||||
switch response.Code {
|
||||
case huibo.CallAPI2StatusSuccess:
|
||||
// 查询成功
|
||||
if response.Data == nil {
|
||||
return []byte("{}"), nil
|
||||
}
|
||||
return respBytes, nil
|
||||
case huibo.CallAPI2StatusNoData:
|
||||
// 查询成功,无数据 - 按产品约定按调用成功计费
|
||||
return []byte("{}"), nil
|
||||
default:
|
||||
// 其他错误状态码
|
||||
message := huibo.GetCallAPI2StatusMessage(response.Code)
|
||||
return nil, errors.Join(processors.ErrDatasource, errors.New(message))
|
||||
}
|
||||
return respBytes, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user