f
This commit is contained in:
@@ -240,6 +240,9 @@ func registerAllProcessors(combService *comb.CombService) {
|
||||
"JRZQV7MD": jrzq.ProcessJRZQV7MDRequest, // 特殊名单
|
||||
"JRZQ5T8S": jrzq.ProcessJRZQ5T8SRequest, // 借贷意向验证V2
|
||||
"JRZQT57Z": jrzq.ProcessJRZQT57ZRequest, // 团伙欺诈风险识别
|
||||
"JRZQK9P2": jrzq.ProcessJRZQK9P2Request, // 洞侦1.0(海宇,查空计费)
|
||||
"JRZQR4N7": jrzq.ProcessJRZQR4N7Request, // 借贷意向验证3.0(海宇,查空计费)
|
||||
"JRZQP8D2": jrzq.ProcessJRZQP8D2Request, // 全景雷达BH(海宇,查空不计费)
|
||||
|
||||
// QYGL系列处理器
|
||||
"QYGL8261": qygl.ProcessQYGL8261Request,
|
||||
|
||||
@@ -342,6 +342,9 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
||||
"QCXGCP77": &dto.QCXGCP77Req{}, //全国车辆配置查验(车辆详情)
|
||||
"JRZQ5T8S": &dto.JRZQ5T8SReq{}, //借贷意向验证V22
|
||||
"JRZQT57Z": &dto.JRZQT57ZReq{}, //团伙欺诈风险识别
|
||||
"JRZQK9P2": &dto.JRZQK9P2Req{}, //洞侦1.0(海宇,查空计费)
|
||||
"JRZQR4N7": &dto.JRZQR4N7Req{}, //借贷意向验证3.0(海宇,查空计费)
|
||||
"JRZQP8D2": &dto.JRZQP8D2Req{}, //全景雷达BH(海宇,查空不计费)
|
||||
"IVYZX7J9": &dto.IVYZX7J9Req{}, //学历核验政务
|
||||
"IVYZFC59": &dto.IVYZFC59Req{}, //房产核验
|
||||
"IVYZGJ99": &dto.IVYZGJ99Req{}, //公积金核验
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package jrzq
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"tyapi-server/internal/domains/api/dto"
|
||||
"tyapi-server/internal/domains/api/services/processors"
|
||||
"tyapi-server/internal/infrastructure/external/haiyuapi"
|
||||
)
|
||||
|
||||
// ProcessJRZQK9P2Request JRZQK9P2 API处理方法 - 洞侦1.0(转发海宇 JRZQK9P2,查空计费)
|
||||
func ProcessJRZQK9P2Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
var paramsDto dto.JRZQK9P2Req
|
||||
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)
|
||||
}
|
||||
|
||||
if deps.HaiyuapiService == nil {
|
||||
return nil, errors.Join(processors.ErrSystem, errors.New("海宇API服务未初始化"))
|
||||
}
|
||||
|
||||
reqParams := map[string]interface{}{
|
||||
"name": paramsDto.Name,
|
||||
"id_card": paramsDto.IDCard,
|
||||
"mobile_no": paramsDto.MobileNo,
|
||||
}
|
||||
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, "JRZQK9P2", reqParams)
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package jrzq
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"tyapi-server/internal/domains/api/dto"
|
||||
"tyapi-server/internal/domains/api/services/processors"
|
||||
"tyapi-server/internal/infrastructure/external/haiyuapi"
|
||||
)
|
||||
|
||||
// ProcessJRZQP8D2Request JRZQP8D2 API处理方法 - 全景雷达BH(转发海宇 JRZQP8D2,查空不计费)
|
||||
func ProcessJRZQP8D2Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
var paramsDto dto.JRZQP8D2Req
|
||||
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)
|
||||
}
|
||||
|
||||
if deps.HaiyuapiService == nil {
|
||||
return nil, errors.Join(processors.ErrSystem, errors.New("海宇API服务未初始化"))
|
||||
}
|
||||
|
||||
reqParams := map[string]interface{}{
|
||||
"name": paramsDto.Name,
|
||||
"id_card": paramsDto.IDCard,
|
||||
"mobile_no": paramsDto.MobileNo,
|
||||
}
|
||||
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, "JRZQP8D2", reqParams)
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package jrzq
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"tyapi-server/internal/domains/api/dto"
|
||||
"tyapi-server/internal/domains/api/services/processors"
|
||||
"tyapi-server/internal/infrastructure/external/haiyuapi"
|
||||
)
|
||||
|
||||
// ProcessJRZQR4N7Request JRZQR4N7 API处理方法 - 借贷意向验证3.0(转发海宇 JRZQR4N7,查空计费)
|
||||
func ProcessJRZQR4N7Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
var paramsDto dto.JRZQR4N7Req
|
||||
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)
|
||||
}
|
||||
|
||||
if deps.HaiyuapiService == nil {
|
||||
return nil, errors.Join(processors.ErrSystem, errors.New("海宇API服务未初始化"))
|
||||
}
|
||||
|
||||
reqParams := map[string]interface{}{
|
||||
"name": paramsDto.Name,
|
||||
"id_card": paramsDto.IDCard,
|
||||
"mobile_no": paramsDto.MobileNo,
|
||||
}
|
||||
|
||||
respBytes, err := deps.HaiyuapiService.CallAPI(ctx, "JRZQR4N7", reqParams)
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user