This commit is contained in:
Mrx
2026-06-09 15:58:29 +08:00
parent a90dfb90ef
commit 9f06027820
6 changed files with 120 additions and 1 deletions

View File

@@ -906,6 +906,11 @@ type QCXG9P1CReq struct {
IDCard string `json:"id_card" validate:"required,validIDCard"`
}
type DWBG9FB3Req struct {
IDCard string `json:"id_card" validate:"required,validIDCard"`
Name string `json:"name" validate:"required,min=1,validName"`
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
}
type QCXG8A3DReq struct {
PlateNo string `json:"plate_no" validate:"required"`
PlateType string `json:"plate_type" validate:"omitempty,oneof=01 02"`

View File

@@ -407,6 +407,7 @@ func registerAllProcessors(combService *comb.CombService) {
"DWBG8B4D": dwbg.ProcessDWBG8B4DRequest,
"DWBG7F3A": dwbg.ProcessDWBG7F3ARequest,
"DWBG5SAM": dwbg.ProcessDWBG5SAMRequest,
"DWBG9FB3": dwbg.ProcessDWBG9FB3Request, // 个人风险档案
// FLXG系列处理器 - 风险管控 (包含原FXHY功能)
"FLXG8B4D": flxg.ProcessFLXG8B4DRequest,

View File

@@ -299,6 +299,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
"IVYZVJJ6": &dto.IVYZVJJ6Req{}, //收入等级tax_income_level_v8
"YYSYTJC4": &dto.YYSYTJC4Req{}, //运营商近三个月欠费次数脉
"YYSYP72D": &dto.YYSYP72DReq{}, //运营商近三个月欠费次数脉
"DWBG9FB3": &dto.DWBG9FB3Req{}, // 个人风险档案
}

View File

@@ -0,0 +1,50 @@
package dwbg
import (
"context"
"encoding/json"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
"tyapi-server/internal/infrastructure/external/nuoer"
)
// ProcessDWBG9FB3Request DWBG9FB3 API处理方法 - 个人风险档案
func ProcessDWBG9FB3Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.DWBG9FB3Req
if err := json.Unmarshal(params, &paramsDto); 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{
"idCard": paramsDto.IDCard,
"name": paramsDto.Name,
"mobile": paramsDto.MobileNo,
}
nuoerDoCheckAPIKey := "gamaReportPageP01"
ApiPath := "/v1/doCheck"
resp, err := deps.NuoerService.CallAPI(ctx, nuoerDoCheckAPIKey, ApiPath, body)
if err != nil {
if errors.Is(err, nuoer.ErrNotFound) {
return nil, errors.Join(processors.ErrNotFound, err)
}
if errors.Is(err, nuoer.ErrDatasource) {
return nil, errors.Join(processors.ErrDatasource, 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
}

View File

@@ -36,7 +36,6 @@ func ProcessQCXG9P1CRequest(ctx context.Context, params []byte, deps *processors
return transformQCXG9P1CResponse(raw)
}
// transformQCXG9P1CResponse 将诺尔响应转为 QCXG9P1C 对外格式:去掉 busiCode/busiMsg展开 resultvehicleCount 为整数
func transformQCXG9P1CResponse(raw []byte) ([]byte, error) {
base := gjson.GetBytes(raw, "result")
if !base.Exists() {