f
This commit is contained in:
@@ -60,7 +60,7 @@ var productHandlers = map[string]queryHandlerFunc{
|
||||
"companyinfo": runMarriageReq,
|
||||
"rentalinfo": runMarriageReq,
|
||||
"preloanbackgroundcheck": runMarriageReq,
|
||||
"backgroundcheck": runMarriageReq,
|
||||
"backgroundcheck": runBackgroundCheckReq,
|
||||
"personalData": runMarriageReq,
|
||||
"toc_PersonalBadRecord": runPersonalBadRecordReq,
|
||||
"toc_PersonalLawsuit": runMarriageReq,
|
||||
@@ -122,7 +122,6 @@ func productHasSmsCode(product string) bool {
|
||||
"companyinfo",
|
||||
"rentalinfo",
|
||||
"preloanbackgroundcheck",
|
||||
"backgroundcheck",
|
||||
"personalData",
|
||||
"toc_PersonalLawsuit",
|
||||
"toc_EnterpriseLawsuit",
|
||||
@@ -217,6 +216,24 @@ func runMarriageReq(l *QueryServiceLogic, decryptData []byte, product string) (m
|
||||
}, nil
|
||||
}
|
||||
|
||||
func runBackgroundCheckReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.BackgroundCheckReq
|
||||
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)
|
||||
}
|
||||
if verifyErr := l.Verify(data.Name, data.IDCard, data.Mobile); verifyErr != nil {
|
||||
return nil, verifyErr
|
||||
}
|
||||
return map[string]interface{}{
|
||||
"name": data.Name,
|
||||
"id_card": data.IDCard,
|
||||
"mobile": data.Mobile,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// runEntLawsuitReq 企业司法涉诉:企业名称+统一社会信用代码+手机+验证码
|
||||
func runEntLawsuitReq(l *QueryServiceLogic, decryptData []byte, product string) (map[string]interface{}, error) {
|
||||
var data types.EntLawsuitReq
|
||||
|
||||
@@ -45,12 +45,10 @@ type PreLoanBackgroundCheckReq struct {
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
// BackgroundCheck 查询请求结构
|
||||
type BackgroundCheckReq struct {
|
||||
Name string `json:"name" validate:"required,name"`
|
||||
IDCard string `json:"id_card" validate:"required,idCard"`
|
||||
Mobile string `json:"mobile" validate:"required,mobile"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
type PersonalDataReq struct {
|
||||
Name string `json:"name" validate:"required,name"`
|
||||
|
||||
Reference in New Issue
Block a user