f
This commit is contained in:
@@ -898,6 +898,11 @@ type YYSYF2T7Req struct {
|
|||||||
DateRange string `json:"date_range" validate:"required,validAuthDate" `
|
DateRange string `json:"date_range" validate:"required,validAuthDate" `
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type QYGL5S1Req struct {
|
||||||
|
EntCode string `json:"ent_code" validate:"omitempty,validUSCI"`
|
||||||
|
EntName string `json:"ent_name" validate:"required,min=1,validEnterpriseName"`
|
||||||
|
}
|
||||||
|
|
||||||
// 数脉 API
|
// 数脉 API
|
||||||
type IVYZ3M8SReq struct {
|
type IVYZ3M8SReq struct {
|
||||||
Name string `json:"name" validate:"required,min=1,validName"`
|
Name string `json:"name" validate:"required,min=1,validName"`
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ func registerAllProcessors(combService *comb.CombService) {
|
|||||||
"QYGL2NAO": qygl.ProcessQYGL2naoRequest, //股权变更
|
"QYGL2NAO": qygl.ProcessQYGL2naoRequest, //股权变更
|
||||||
"QYGLNIO8": qygl.ProcessQYGLNIO8Request, //企业基本信息
|
"QYGLNIO8": qygl.ProcessQYGLNIO8Request, //企业基本信息
|
||||||
"QYGLP0HT": qygl.ProcessQYGLP0HTRequest, //股权穿透
|
"QYGLP0HT": qygl.ProcessQYGLP0HTRequest, //股权穿透
|
||||||
|
"QYGL5S1": qygl.ProcessQYGL5S1Request, //企业司法涉诉V2
|
||||||
|
|
||||||
// YYSY系列处理器
|
// YYSY系列处理器
|
||||||
"YYSYD50F": yysy.ProcessYYSYD50FRequest,
|
"YYSYD50F": yysy.ProcessYYSYD50FRequest,
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
|||||||
"IVYZ6G7H": &dto.IVYZ6G7HReq{},
|
"IVYZ6G7H": &dto.IVYZ6G7HReq{},
|
||||||
"IVYZ8I9J": &dto.IVYZ8I9JReq{},
|
"IVYZ8I9J": &dto.IVYZ8I9JReq{},
|
||||||
"JRZQ0L85": &dto.JRZQ0L85Req{},
|
"JRZQ0L85": &dto.JRZQ0L85Req{},
|
||||||
"COMBHZY2": &dto.COMBHZY2Req{}, // 自此无imp11.28
|
"COMBHZY2": &dto.COMBHZY2Req{}, //
|
||||||
"QCXG8A3D": &dto.QCXG8A3DReq{},
|
"QCXG8A3D": &dto.QCXG8A3DReq{},
|
||||||
"QCXG6B4E": &dto.QCXG6B4EReq{},
|
"QCXG6B4E": &dto.QCXG6B4EReq{},
|
||||||
"QYGL2B5C": &dto.QYGL2B5CReq{},
|
"QYGL2B5C": &dto.QYGL2B5CReq{},
|
||||||
@@ -243,6 +243,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
|||||||
"YYSYH6F3": &dto.YYSYH6F3Req{}, //运营商三要素简版即时版查询
|
"YYSYH6F3": &dto.YYSYH6F3Req{}, //运营商三要素简版即时版查询
|
||||||
"IVYZX5Q2": &dto.IVYZX5Q2Req{}, //活体识别步骤二
|
"IVYZX5Q2": &dto.IVYZX5Q2Req{}, //活体识别步骤二
|
||||||
"PDFG01GZ": &dto.PDFG01GZReq{}, //
|
"PDFG01GZ": &dto.PDFG01GZReq{}, //
|
||||||
|
"QYGL5S1": &dto.QYGL5S1Req{}, //企业司法涉诉V2
|
||||||
}
|
}
|
||||||
|
|
||||||
// 优先返回已配置的DTO
|
// 优先返回已配置的DTO
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package qygl
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"tyapi-server/internal/domains/api/dto"
|
||||||
|
"tyapi-server/internal/domains/api/services/processors"
|
||||||
|
"tyapi-server/internal/infrastructure/external/zhicha"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProcessQYGL5S1Request QYGL5S1 API处理方法 - 企业司法涉诉V2
|
||||||
|
func ProcessQYGL5S1Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||||
|
|
||||||
|
var paramsDto dto.QYGL5S1Req
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
encryptedEntCode, err := deps.ZhichaService.Encrypt(paramsDto.EntCode)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
encryptedEntName, err := deps.ZhichaService.Encrypt(paramsDto.EntName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
reqData := map[string]interface{}{
|
||||||
|
"enterpriseNo": encryptedEntCode,
|
||||||
|
"enterpriseName": encryptedEntName,
|
||||||
|
}
|
||||||
|
|
||||||
|
respData, err := deps.ZhichaService.CallAPI(ctx, "ZCI088", reqData)
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, zhicha.ErrDatasource) {
|
||||||
|
return nil, errors.Join(processors.ErrDatasource, err)
|
||||||
|
} else {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将响应数据转换为JSON字节
|
||||||
|
respBytes, err := json.Marshal(respData)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return respBytes, nil
|
||||||
|
}
|
||||||
@@ -10,6 +10,21 @@ import (
|
|||||||
"tyapi-server/internal/infrastructure/external/westdex"
|
"tyapi-server/internal/infrastructure/external/westdex"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// YYSYF7DBResponse 手机二次卡查询成功响应
|
||||||
|
type YYSYF7DBResponse struct {
|
||||||
|
Code string `json:"code"`
|
||||||
|
Data YYSYF7DBResponseData `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// YYSYF7DBResponseData 手机二次卡 data 结构
|
||||||
|
type YYSYF7DBResponseData struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
EncryptType string `json:"encryptType"`
|
||||||
|
Guid string `json:"guid"`
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
PhoneType string `json:"phoneType"`
|
||||||
|
}
|
||||||
|
|
||||||
// ProcessYYSYF7DBRequest YYSYF7DB API处理方法
|
// ProcessYYSYF7DBRequest YYSYF7DB API处理方法
|
||||||
func ProcessYYSYF7DBRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
func ProcessYYSYF7DBRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||||
var paramsDto dto.YYSYF7DBReq
|
var paramsDto dto.YYSYF7DBReq
|
||||||
@@ -42,5 +57,9 @@ func ProcessYYSYF7DBRequest(ctx context.Context, params []byte, deps *processors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return respBytes, nil
|
var mapped YYSYF7DBResponse
|
||||||
|
if err := json.Unmarshal(respBytes, &mapped); err != nil {
|
||||||
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
|
}
|
||||||
|
return json.Marshal(mapped)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user