企业五要素
This commit is contained in:
@@ -113,10 +113,18 @@ func ProcessQYGL5CMPRequest(ctx context.Context, params []byte, deps *processors
|
|||||||
"data": response.Data,
|
"data": response.Data,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 解析status响应(将JSON字节解析为对象)
|
||||||
|
statusBytes := createStatusResponsess(0) // 验证通过,status为0
|
||||||
|
var statusData map[string]interface{}
|
||||||
|
if err := json.Unmarshal(statusBytes, &statusData); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, fmt.Errorf("解析status响应失败: %w", err))
|
||||||
|
}
|
||||||
|
|
||||||
// 合并两个API的返回数据
|
// 合并两个API的返回数据
|
||||||
mergedData := map[string]interface{}{
|
mergedData := map[string]interface{}{
|
||||||
"Personal Information": xingweiData, // 星维API返回的数据
|
"Personal Information": xingweiData, // 星维API返回的数据
|
||||||
"Enterprise Information": tianYanChaData, // 天眼查API返回的数据
|
"Enterprise Information": tianYanChaData, // 天眼查API返回的数据
|
||||||
|
"status": statusData, // 解析后的status对象
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将合并后的数据序列化为JSON
|
// 将合并后的数据序列化为JSON
|
||||||
@@ -132,8 +140,7 @@ func ProcessQYGL5CMPRequest(ctx context.Context, params []byte, deps *processors
|
|||||||
// createStatusResponsess 创建状态响应
|
// createStatusResponsess 创建状态响应
|
||||||
func createStatusResponsess(status int) []byte {
|
func createStatusResponsess(status int) []byte {
|
||||||
response := map[string]interface{}{
|
response := map[string]interface{}{
|
||||||
"status": status,
|
"status": status,
|
||||||
"message": "企业信息不通过",
|
|
||||||
}
|
}
|
||||||
respBytes, _ := json.Marshal(response)
|
respBytes, _ := json.Marshal(response)
|
||||||
return respBytes
|
return respBytes
|
||||||
|
|||||||
Reference in New Issue
Block a user