f
This commit is contained in:
@@ -1091,6 +1091,7 @@ func (s *ProductApplicationServiceImpl) getDTOMap() map[string]interface{} {
|
||||
"JRZQR4N7": &dto.JRZQR4N7Req{}, //借贷意向验证3.0
|
||||
"JRZQH6M3": &dto.JRZQH6M3Req{}, //无间司南-纯黑A版
|
||||
"JRZQW3L8": &dto.JRZQW3L8Req{}, //信用司南
|
||||
"JRZQP8D2": &dto.JRZQP8D2Req{}, //全景雷达BH
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -240,6 +240,13 @@ type JRZQW3L8Req struct {
|
||||
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
||||
}
|
||||
|
||||
// JRZQP8D2Req 全景雷达BH
|
||||
type JRZQP8D2Req 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 QCXG76VAReq struct {
|
||||
PlateNo string `json:"plate_no" validate:"required"`
|
||||
}
|
||||
|
||||
@@ -207,6 +207,7 @@ func registerAllProcessors(combService *comb.CombService) {
|
||||
"JRZQR4N7": jrzq.ProcessJRZQR4N7Request, //借贷意向验证3.0
|
||||
"JRZQH6M3": jrzq.ProcessJRZQH6M3Request, //无间司南-纯黑A版
|
||||
"JRZQW3L8": jrzq.ProcessJRZQW3L8Request, //信用司南
|
||||
"JRZQP8D2": jrzq.ProcessJRZQP8D2Request, //全景雷达BH
|
||||
"JRZQ0OO1": jrzq.ProcessJRZQ0OO1Request, //戎行贷后信息
|
||||
|
||||
// QYGL系列处理器
|
||||
|
||||
@@ -316,6 +316,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
||||
"JRZQR4N7": &dto.JRZQR4N7Req{}, //借贷意向验证3.0
|
||||
"JRZQH6M3": &dto.JRZQH6M3Req{}, //无间司南-纯黑A版
|
||||
"JRZQW3L8": &dto.JRZQW3L8Req{}, //信用司南
|
||||
"JRZQP8D2": &dto.JRZQP8D2Req{}, //全景雷达BH
|
||||
"IVYZX7J9": &dto.IVYZX7J9Req{}, //学籍核验
|
||||
"QCXG6U5G": &dto.QCXG6U5GReq{}, //车辆核验
|
||||
"JRZQ0OO1": &dto.JRZQ0OO1Req{}, //戎行贷后信息 Info360
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package jrzq
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"hyapi-server/internal/domains/api/dto"
|
||||
"hyapi-server/internal/domains/api/services/processors"
|
||||
"hyapi-server/internal/infrastructure/external/jiyi"
|
||||
)
|
||||
|
||||
// ProcessJRZQP8D2Request 全景雷达BH(上游 jy000003,查空不计费;三要素 MD5 入参)
|
||||
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)
|
||||
}
|
||||
|
||||
body := map[string]string{
|
||||
"name": jiyi.MD5Encrypt(paramsDto.Name),
|
||||
"idCard": jiyi.MD5Encrypt(paramsDto.IDCard),
|
||||
"mobile": jiyi.MD5Encrypt(paramsDto.MobileNo),
|
||||
}
|
||||
|
||||
apiKey := "jy000003"
|
||||
apiPath := "/api/v1/panorama/encrypt"
|
||||
|
||||
resp, err := deps.JiyiService.CallAPI(ctx, apiKey, apiPath, body, jiyi.DefaultCallOptions())
|
||||
if err != nil {
|
||||
if errors.Is(err, jiyi.ErrDatasource) {
|
||||
return nil, errors.Join(processors.ErrDatasource, err)
|
||||
}
|
||||
if errors.Is(err, jiyi.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
|
||||
}
|
||||
@@ -50,4 +50,7 @@ func TestIsQueryBillingAPIKey(t *testing.T) {
|
||||
if isQueryBillingAPIKey("jy000004") {
|
||||
t.Fatal("信用司南查空不计费,不应在白名单中")
|
||||
}
|
||||
if isQueryBillingAPIKey("jy000002") || isQueryBillingAPIKey("jy000003") {
|
||||
t.Fatal("全景雷达PD查空不计费,不应在白名单中")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@ const (
|
||||
const (
|
||||
BusiCodeSuccess = 10 // 查询成功
|
||||
BusiCodeNotFound = 1000 // 未查得
|
||||
BusiCodeProductError = 1004 // 产品编号异常
|
||||
BusiCodeSignError = 1005 // 签名异常
|
||||
BusiCodeDataRequestError = 1007 // 数据请求异常
|
||||
BusiCodeServiceNotOpen = 1008 // 服务尚未开通或已暂停
|
||||
BusiCodeParamError = 1010 // 参数错误
|
||||
BusiCodeUnknown = -1 // 未知错误
|
||||
)
|
||||
@@ -35,8 +37,10 @@ var platformCodeDesc = map[int]string{
|
||||
var busiCodeDesc = map[int]string{
|
||||
BusiCodeSuccess: "查询成功",
|
||||
BusiCodeNotFound: "未查得",
|
||||
BusiCodeProductError: "产品编号异常",
|
||||
BusiCodeSignError: "签名异常",
|
||||
BusiCodeDataRequestError: "数据请求异常",
|
||||
BusiCodeServiceNotOpen: "服务尚未开通或已暂停使用",
|
||||
BusiCodeParamError: "参数错误",
|
||||
BusiCodeUnknown: "未知错误",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user