f
This commit is contained in:
@@ -65,7 +65,7 @@ func ProcessQYGL4B2ERequest(
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
if errors.Is(err, shujubao.ErrQueryEmpty) {
|
||||
data = map[string]interface{}{}
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
} else {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
@@ -11,6 +11,19 @@ import (
|
||||
"tyapi-server/internal/infrastructure/external/shujubao"
|
||||
)
|
||||
|
||||
// emptyQYGL6S1BResult 数据宝成功但无 resultData 时返回的空业务结构
|
||||
func emptyQYGL6S1BResult() ([]byte, error) {
|
||||
emptyResult := map[string]interface{}{
|
||||
"caseInfoList": []interface{}{},
|
||||
"legRepInfoList": []interface{}{},
|
||||
"lossPromiseList": []interface{}{},
|
||||
"performerList": []interface{}{},
|
||||
"ryPosPerList": []interface{}{},
|
||||
"shareholderList": []interface{}{},
|
||||
}
|
||||
return json.Marshal(emptyResult)
|
||||
}
|
||||
|
||||
// ProcessQYGL6S1BRequest QYGL6S1B API处理方法 - 董监高司法综合信息核验(使用数据宝服务)
|
||||
|
||||
func ProcessQYGL6S1BRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
@@ -38,7 +51,6 @@ func ProcessQYGL6S1BRequest(ctx context.Context, params []byte, deps *processors
|
||||
}
|
||||
if errors.Is(err, shujubao.ErrQueryEmpty) {
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
// data = map[string]interface{}{}
|
||||
} else {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
@@ -58,16 +70,7 @@ func ProcessQYGL6S1BRequest(ctx context.Context, params []byte, deps *processors
|
||||
|
||||
resultDataValue, exists := resultData["resultData"]
|
||||
if !exists {
|
||||
// 如果 resultData 不存在,说明查询为空,返回空的业务数据结构
|
||||
emptyResult := map[string]interface{}{
|
||||
"caseInfoList": []interface{}{},
|
||||
"legRepInfoList": []interface{}{},
|
||||
"lossPromiseList": []interface{}{},
|
||||
"performerList": []interface{}{},
|
||||
"ryPosPerList": []interface{}{},
|
||||
"shareholderList": []interface{}{},
|
||||
}
|
||||
return json.Marshal(emptyResult)
|
||||
return emptyQYGL6S1BResult()
|
||||
}
|
||||
|
||||
// 转换数据类型:将数字字段转换为字符串
|
||||
|
||||
@@ -95,7 +95,7 @@ func ProcessQYGL7D9ARequest(ctx context.Context, params []byte, deps *processors
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
if errors.Is(err, shujubao.ErrQueryEmpty) {
|
||||
data = map[string]interface{}{}
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
} else {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ func ProcessQYGL8B4DRequest(ctx context.Context, params []byte, deps *processors
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
if errors.Is(err, shujubao.ErrQueryEmpty) {
|
||||
data = map[string]interface{}{}
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
} else {
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user