f
This commit is contained in:
@@ -62,6 +62,7 @@ var productHandlers = map[string]queryHandlerFunc{
|
||||
"preloanbackgroundcheck": runMarriageReq,
|
||||
"backgroundcheck": runMarriageReq,
|
||||
"personalData": runMarriageReq,
|
||||
"toc_PersonalBadRecord": runPersonalBadRecordReq,
|
||||
"toc_PersonalLawsuit": runMarriageReq,
|
||||
"toc_EnterpriseLawsuit": runEntLawsuitReq,
|
||||
// 人企关系加强版:仅身份证号
|
||||
@@ -276,6 +277,21 @@ func runLimitHighExecutedReq(l *QueryServiceLogic, decryptData []byte, product s
|
||||
}, nil
|
||||
}
|
||||
|
||||
// 本人不良 FLXGDEA9:姓名 + 身份证(授权由 ApiRequest 默认传 1)
|
||||
func runPersonalBadRecordReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.PersonalBadRecordReq
|
||||
if unmarshalErr := json.Unmarshal(decryptData, &data); unmarshalErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "查询服务, 解密后的数据格式不正确: %+v", unmarshalErr)
|
||||
}
|
||||
if validatorErr := validator.Validate(data); validatorErr != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCodeMsg(xerr.PARAM_VERIFICATION_ERROR, validatorErr.Error()), "查询服务, 参数不正确: %+v", validatorErr)
|
||||
}
|
||||
return map[string]interface{}{
|
||||
"name": data.Name,
|
||||
"id_card": data.IDCard,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// 失信被执行人 QYGL2S0W
|
||||
func runDishonestExecutedReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.DishonestExecutedReq
|
||||
|
||||
@@ -269,6 +269,7 @@ var requestProcessors = map[string]func(*ApiRequestService, []byte) ([]byte, err
|
||||
"QYGL66SL": (*ApiRequestService).ProcessQYGL66SLRequest,
|
||||
"FLXG3A9B": (*ApiRequestService).ProcessFLXG3A9BRequest,
|
||||
"QYGL2S0W": (*ApiRequestService).ProcessQYGL2S0WRequest,
|
||||
"FLXGDEA9": (*ApiRequestService).ProcessFLXGDEA9Request,
|
||||
}
|
||||
|
||||
// PreprocessRequestApi 调用指定的请求处理函数
|
||||
@@ -1505,6 +1506,23 @@ func (a *ApiRequestService) ProcessQYGL2S0WRequest(params []byte) ([]byte, error
|
||||
return a.processVerifyPassThrough(params, "QYGL2S0W")
|
||||
}
|
||||
|
||||
// FLXGDEA9 本人不良
|
||||
func (a *ApiRequestService) ProcessFLXGDEA9Request(params []byte) ([]byte, error) {
|
||||
var m map[string]interface{}
|
||||
if err := json.Unmarshal(params, &m); err != nil {
|
||||
return nil, fmt.Errorf("api请求, FLXGDEA9, 解析参数失败: %w", err)
|
||||
}
|
||||
// 授权由后端默认传 1,前端与查询服务不再感知 authorized
|
||||
if v, ok := m["authorized"]; !ok || v == "" {
|
||||
m["authorized"] = "1"
|
||||
}
|
||||
resp, err := a.tianyuanapi.CallInterface("FLXGDEA9", m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return convertTianyuanResponse(resp)
|
||||
}
|
||||
|
||||
// buildVehicleBody 从 params 中取 required 与 optional 键,仅非空才写入 body
|
||||
func buildVehicleBody(params []byte, required, optional []string) map[string]interface{} {
|
||||
body := make(map[string]interface{})
|
||||
|
||||
@@ -85,6 +85,12 @@ type DishonestExecutedReq struct {
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
}
|
||||
|
||||
// PersonalBadRecord 本人不良(FLXGDEA9):姓名 + 身份证(授权由 ApiRequest 默认传 1)
|
||||
type PersonalBadRecordReq struct {
|
||||
Name string `json:"name" validate:"required,name"`
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
}
|
||||
|
||||
// TocPersonEnterprisePro 人企关系加强版预查询:仅身份证号
|
||||
type TocPersonEnterpriseProReq struct {
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
|
||||
Reference in New Issue
Block a user