This commit is contained in:
2026-06-22 18:49:16 +08:00
parent 0ebec305c4
commit 18c222a0b5
6 changed files with 162 additions and 1 deletions

View File

@@ -84,6 +84,19 @@ type IVYZ9363Req struct {
WomanIDCard string `json:"woman_id_card" validate:"required,validIDCard"`
}
type IVYZX7J9Req struct {
Name string `json:"name" validate:"required,min=1,validName"`
IDCard string `json:"id_card" validate:"required,validIDCard"`
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
}
type IVYZFC59Req struct {
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
}
type IVYZGJ99Req struct {
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
}
type JRZQ0A03Req struct {
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
IDCard string `json:"id_card" validate:"required,validIDCard"`

View File

@@ -371,6 +371,8 @@ func registerAllProcessors(combService *comb.CombService) {
"IVYZ2MN7": ivyz.ProcessIVYZ2MN7Request, //学历B
"IVYZ4Y27": ivyz.ProcessIVYZ4Y27Request, //学历高级版
"IVYZVJJ6": ivyz.ProcessIVYZVJJ6Request, //收入等级tax_income_level_v8
"IVYZX7J9": ivyz.ProcessIVYZX7J9Request, // 学历核验政务
"IVYZFC59": ivyz.ProcessIVYZFC59Request, // 房产核验
// COMB系列处理器 - 只注册有自定义逻辑的组合包
"COMB86PM": comb.ProcessCOMB86PMRequest, // 有自定义逻辑重命名ApiCode

View File

@@ -339,7 +339,8 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
"QCXGA8V3": &dto.QCXGA8V3Req{}, //全国车辆配置查验(车五项+使用性质+承保)
"JRZQ5T8S": &dto.JRZQ5T8SReq{}, //借贷意向验证V22
"JRZQT57Z": &dto.JRZQT57ZReq{}, //团伙欺诈风险识别
"JRZQX7J9": &dto.IVYZX7J9Req{}, //学历核验政务
"JRZQFC59": &dto.IVYZFC59Req{}, //房产核验
}
// 优先返回已配置的DTO

View File

@@ -0,0 +1,48 @@
package ivyz
import (
"context"
"encoding/json"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
"tyapi-server/internal/infrastructure/external/nuoer"
)
// ProcessIVYZFC59Request IVYZFC59 API处理方法 -房产核验
func ProcessIVYZFC59Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.IVYZFC59Req
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{
"mobile": nuoer.MD5(paramsDto.MobileNo),
}
nuoerDoCheckAPIKey := "idVerify126"
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
}

View File

@@ -0,0 +1,48 @@
package ivyz
import (
"context"
"encoding/json"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
"tyapi-server/internal/infrastructure/external/nuoer"
)
// ProcessIVYZGJ99Request IVYZGJ99 API处理方法 -房产核验
func ProcessIVYZGJ99Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.IVYZGJ99Req
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{
"mobile": nuoer.MD5(paramsDto.MobileNo),
}
nuoerDoCheckAPIKey := "idVerify127"
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
}

View File

@@ -0,0 +1,49 @@
package ivyz
import (
"context"
"encoding/json"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
"tyapi-server/internal/infrastructure/external/nuoer"
)
// ProcessIVYZX7J9Request IVYZX7J9 API处理方法 -收入等级tax_income_level_v8
func ProcessIVYZX7J9Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.IVYZX7J9Req
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{
"name": nuoer.MD5(paramsDto.Name),
"idCard": nuoer.MD5(paramsDto.IDCard),
}
nuoerDoCheckAPIKey := "idVerify125"
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
}