add QCXG7K2N
This commit is contained in:
@@ -199,6 +199,10 @@ type QCXG3M7ZReq struct {
|
||||
Name string `json:"name" validate:"required,min=1,validName"`
|
||||
PlateColor string `json:"plate_color" validate:"omitempty"`
|
||||
}
|
||||
type QCXG7K2NReq struct {
|
||||
PlateNo string `json:"plate_no" validate:"required"`
|
||||
Name string `json:"name" validate:"required,min=1,validName"`
|
||||
}
|
||||
type QCXG3B8ZReq struct {
|
||||
PlateNo string `json:"plate_no" validate:"required"`
|
||||
}
|
||||
|
||||
@@ -407,6 +407,7 @@ func registerAllProcessors(combService *comb.CombService) {
|
||||
"QCXG5U0Z": qcxg.ProcessQCXG5U0ZRequest, // 车辆静态信息查询 10479
|
||||
"QCXGY7F2": qcxg.ProcessQCXGY7F2Request, // 二手车VIN估值 10443
|
||||
"QCXG3M7Z": qcxg.ProcessQCXG3M7ZRequest, //人车关系核验(ETC)10093 月更
|
||||
"QCXG7K2N": qcxg.ProcessQCXG7K2NRequest, //人车核验加强版
|
||||
"QCXGM4CL": qcxg.ProcessQCXGM4CLRequest, //名下车辆诺尔
|
||||
"QYGLVR76": qygl.ProcessQYGLVR76Request, //名下企业诺尔
|
||||
"QCXG1S2L": qcxg.ProcessQCXG1S2LRequest, //车辆车五项信息核验V2
|
||||
|
||||
@@ -291,6 +291,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
||||
"QCXGY7F2": &dto.QCXGY7F2Req{}, //二手车VIN估值 10443
|
||||
"YYSYK9R4": &dto.YYSYK9R4Req{}, //全网手机三要素验证1979周更新版
|
||||
"QCXG3M7Z": &dto.QCXG3M7ZReq{}, //人车关系核验(ETC)10093 月更
|
||||
"QCXG7K2N": &dto.QCXG7K2NReq{}, //人车核验加强版
|
||||
"JRZQ1P5G": &dto.JRZQ1P5GReq{}, //全国自然人借贷压力指数查询(2)
|
||||
"IVYZOCR1": &dto.IVYZOCR1Req{}, //身份证OCR
|
||||
"IVYZOCR2": &dto.IVYZOCR1Req{}, //身份证OCR2数卖
|
||||
|
||||
@@ -32,8 +32,7 @@ func ProcessFLXGHB4FRequest(ctx context.Context, params []byte, deps *processors
|
||||
"auth_pdf_base64": paramsDto.AuthAuthorizeFileBase64,
|
||||
}
|
||||
|
||||
apiPath := "/api/v1/FLXGC4CT"
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, apiPath, reqParams)
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, "FLXGC4CT", reqParams)
|
||||
if err != nil {
|
||||
if errors.Is(err, haiyuapi.ErrNotFound) {
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
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/haiyuapi"
|
||||
"tyapi-server/internal/infrastructure/external/shujubao"
|
||||
)
|
||||
|
||||
// ProcessQCXG7K2NRequest QCXG7K2N 人车核验加强版:
|
||||
// 优先走数据宝 10093(人车关系核验 ETC),查无结果时降级走海宇 QCXGX2X6(行驶证信息核验V2)。
|
||||
func ProcessQCXG7K2NRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
var paramsDto dto.QCXG7K2NReq
|
||||
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)
|
||||
}
|
||||
|
||||
data, err := deps.ShujubaoService.CallAPI(ctx, "/communication/personal/10093", map[string]interface{}{
|
||||
"key": "a2f32fc54b44ebc85b97a2aaff1734ec",
|
||||
"carNo": paramsDto.PlateNo,
|
||||
"name": paramsDto.Name,
|
||||
})
|
||||
if err == nil {
|
||||
respBytes, marshalErr := json.Marshal(data)
|
||||
if marshalErr != nil {
|
||||
return nil, errors.Join(processors.ErrSystem, marshalErr)
|
||||
}
|
||||
return respBytes, nil
|
||||
}
|
||||
if !errors.Is(err, shujubao.ErrQueryEmpty) {
|
||||
if errors.Is(err, shujubao.ErrDatasource) {
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
|
||||
if deps.HaiyuapiService == nil {
|
||||
return nil, errors.Join(processors.ErrSystem, errors.New("海宇API服务未初始化"))
|
||||
}
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, "QCXGX2X6", map[string]interface{}{
|
||||
"plate_no": paramsDto.PlateNo,
|
||||
"name": paramsDto.Name,
|
||||
})
|
||||
if err != nil {
|
||||
if errors.Is(err, haiyuapi.ErrNotFound) {
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
}
|
||||
if errors.Is(err, haiyuapi.ErrDatasource) {
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
return nil, errors.Join(processors.ErrSystem, err)
|
||||
}
|
||||
return respBytes, nil
|
||||
}
|
||||
@@ -30,8 +30,7 @@ func ProcessQYGLBH7YRequest(ctx context.Context, params []byte, deps *processors
|
||||
"auth_pdf_base64": paramsDto.AuthAuthorizeFileBase64,
|
||||
}
|
||||
|
||||
apiPath := "/api/v1/QYGLLUCM"
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, apiPath, reqParams)
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, "QYGLLUCM", reqParams)
|
||||
if err != nil {
|
||||
if errors.Is(err, haiyuapi.ErrNotFound) {
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
|
||||
Reference in New Issue
Block a user