fadd
This commit is contained in:
@@ -89,6 +89,9 @@ type IVYZX7J9Req struct {
|
|||||||
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type QCXG6U5GReq struct {
|
||||||
|
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
||||||
|
}
|
||||||
type IVYZFC59Req struct {
|
type IVYZFC59Req struct {
|
||||||
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,6 +411,7 @@ func registerAllProcessors(combService *comb.CombService) {
|
|||||||
"QYGLVR76": qygl.ProcessQYGLVR76Request, //名下企业诺尔
|
"QYGLVR76": qygl.ProcessQYGLVR76Request, //名下企业诺尔
|
||||||
"QCXG1S2L": qcxg.ProcessQCXG1S2LRequest, //车辆车五项信息核验V2
|
"QCXG1S2L": qcxg.ProcessQCXG1S2LRequest, //车辆车五项信息核验V2
|
||||||
"QCXGA8V3": qcxg.ProcessQCXGA8V3Request, //全国车辆配置查验(车五项+使用性质+承保)
|
"QCXGA8V3": qcxg.ProcessQCXGA8V3Request, //全国车辆配置查验(车五项+使用性质+承保)
|
||||||
|
"QCXG6U5G": qcxg.ProcessQCXG6U5GRequest, //名下车辆核验
|
||||||
// DWBG系列处理器 - 多维报告
|
// DWBG系列处理器 - 多维报告
|
||||||
"DWBG6A2C": dwbg.ProcessDWBG6A2CRequest,
|
"DWBG6A2C": dwbg.ProcessDWBG6A2CRequest,
|
||||||
"DWBG8B4D": dwbg.ProcessDWBG8B4DRequest,
|
"DWBG8B4D": dwbg.ProcessDWBG8B4DRequest,
|
||||||
|
|||||||
@@ -342,6 +342,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
|||||||
"IVYZX7J9": &dto.IVYZX7J9Req{}, //学历核验政务
|
"IVYZX7J9": &dto.IVYZX7J9Req{}, //学历核验政务
|
||||||
"IVYZFC59": &dto.IVYZFC59Req{}, //房产核验
|
"IVYZFC59": &dto.IVYZFC59Req{}, //房产核验
|
||||||
"IVYZGJ99": &dto.IVYZGJ99Req{}, //公积金核验
|
"IVYZGJ99": &dto.IVYZGJ99Req{}, //公积金核验
|
||||||
|
"QCXG6U5G": &dto.QCXG6U5GReq{}, //名下车辆核验
|
||||||
}
|
}
|
||||||
|
|
||||||
// 优先返回已配置的DTO
|
// 优先返回已配置的DTO
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package qcxg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"tyapi-server/internal/domains/api/dto"
|
||||||
|
"tyapi-server/internal/domains/api/services/processors"
|
||||||
|
"tyapi-server/internal/infrastructure/external/nuoer"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProcessQCXG6U5GRequest QCXG6U5G API处理方法 -名下车辆核验
|
||||||
|
func ProcessQCXG6U5GRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||||
|
var paramsDto dto.QCXG6U5GReq
|
||||||
|
if err := json.Unmarshal(params, ¶msDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
body := map[string]string{
|
||||||
|
"mobile": nuoer.MD5(paramsDto.MobileNo),
|
||||||
|
}
|
||||||
|
|
||||||
|
nuoerDoCheckAPIKey := "idVerify130"
|
||||||
|
ApiPath := "/v1/doCheck"
|
||||||
|
|
||||||
|
resp, err := deps.NuoerService.CallAPI(ctx, nuoerDoCheckAPIKey, ApiPath, body, nuoer.WithEncryptionType(2))
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, nuoer.ErrDatasource) {
|
||||||
|
return nil, errors.Join(processors.ErrDatasource, err)
|
||||||
|
}
|
||||||
|
if errors.Is(err, nuoer.ErrNotFound) {
|
||||||
|
return nil, errors.Join(processors.ErrNotFound, err)
|
||||||
|
}
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
respBytes, err := json.Marshal(resp.Data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return respBytes, nil
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user