f
This commit is contained in:
@@ -5,7 +5,6 @@ type PDFG01GZReq struct {
|
|||||||
Name string `json:"name" validate:"required,min=1,validName"`
|
Name string `json:"name" validate:"required,min=1,validName"`
|
||||||
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
||||||
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
||||||
AuthAuthorizeFileCode string `json:"auth_authorize_file_code" validate:"required"` // IVYZ5A9O需要
|
|
||||||
Authorized string `json:"authorized" validate:"required,oneof=0 1"` // 授权标识,0或1
|
Authorized string `json:"authorized" validate:"required,oneof=0 1"` // 授权标识,0或1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ func ProcessPDFG01GZRequest(ctx context.Context, params []byte, deps *processors
|
|||||||
zap.String("id_card", paramsDto.IDCard),
|
zap.String("id_card", paramsDto.IDCard),
|
||||||
zap.String("mobile_no", paramsDto.MobileNo),
|
zap.String("mobile_no", paramsDto.MobileNo),
|
||||||
zap.String("authorized", paramsDto.Authorized),
|
zap.String("authorized", paramsDto.Authorized),
|
||||||
zap.String("auth_authorize_file_code", paramsDto.AuthAuthorizeFileCode),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// 从context获取config(如果存在)
|
// 从context获取config(如果存在)
|
||||||
@@ -219,35 +218,29 @@ func collectAPIData(ctx context.Context, params dto.PDFG01GZReq, deps *processor
|
|||||||
|
|
||||||
results := make(chan processorResult, 5)
|
results := make(chan processorResult, 5)
|
||||||
|
|
||||||
// 调用IVYZ5A9O - 需要: name, id_card, auth_authorize_file_code
|
// 调用JRZQ0L85 - 需要: name, id_card, mobile_no
|
||||||
go func() {
|
go func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
logger.Error("调用IVYZ5A9O处理器时发生panic",
|
logger.Error("调用JRZQ0L85处理器时发生panic",
|
||||||
zap.Any("panic", r),
|
zap.Any("panic", r),
|
||||||
)
|
)
|
||||||
results <- processorResult{"IVYZ5A9O", nil, fmt.Errorf("处理器panic: %v", r)}
|
results <- processorResult{"JRZQ0L85", nil, fmt.Errorf("处理器panic: %v", r)}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
// 检查必需字段
|
jrzq0l85Params := map[string]interface{}{
|
||||||
if params.AuthAuthorizeFileCode == "" {
|
"name": params.Name,
|
||||||
logger.Warn("IVYZ5A9O缺少auth_authorize_file_code字段,跳过调用")
|
"id_card": params.IDCard,
|
||||||
results <- processorResult{"IVYZ5A9O", nil, fmt.Errorf("缺少必需字段: auth_authorize_file_code")}
|
"mobileNo": params.MobileNo,
|
||||||
return
|
|
||||||
}
|
}
|
||||||
ivyzParams := map[string]interface{}{
|
paramsBytes, err := json.Marshal(jrzq0l85Params)
|
||||||
"name": params.Name,
|
|
||||||
"id_card": params.IDCard,
|
|
||||||
"auth_authorize_file_code": params.AuthAuthorizeFileCode,
|
|
||||||
}
|
|
||||||
paramsBytes, err := json.Marshal(ivyzParams)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn("序列化IVYZ5A9O参数失败", zap.Error(err))
|
logger.Warn("序列化JRZQ0L85参数失败", zap.Error(err))
|
||||||
results <- processorResult{"IVYZ5A9O", nil, err}
|
results <- processorResult{"JRZQ0L85", nil, err}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data, err := callProcessor(ctx, "IVYZ5A9O", paramsBytes, deps)
|
data, err := callProcessor(ctx, "JRZQ0L85", paramsBytes, deps)
|
||||||
results <- processorResult{"IVYZ5A9O", data, err}
|
results <- processorResult{"JRZQ0L85", data, err}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// 调用JRZQ8A2D - 需要: name, id_card, mobile_no, authorized
|
// 调用JRZQ8A2D - 需要: name, id_card, mobile_no, authorized
|
||||||
|
|||||||
Reference in New Issue
Block a user