fix
This commit is contained in:
@@ -31,7 +31,7 @@ type FLXG162AReq struct {
|
|||||||
type FLXG0687Req struct {
|
type FLXG0687Req struct {
|
||||||
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
IDCard string `json:"id_card" validate:"required,validIDCard"`
|
||||||
}
|
}
|
||||||
type FLXG21Req struct {
|
type FLXGBC21Req struct {
|
||||||
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"`
|
||||||
}
|
}
|
||||||
type FLXG970FReq struct {
|
type FLXG970FReq struct {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type FormField struct {
|
|||||||
|
|
||||||
// FormConfig 表单配置
|
// FormConfig 表单配置
|
||||||
type FormConfig struct {
|
type FormConfig struct {
|
||||||
ApiCode string `json:"api_code"`
|
ApiCode string `json:"api_code"`
|
||||||
Fields []FormField `json:"fields"`
|
Fields []FormField `json:"fields"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(apiCode string) interface{} {
|
|||||||
"FLXG54F5": &dto.FLXG54F5Req{},
|
"FLXG54F5": &dto.FLXG54F5Req{},
|
||||||
"FLXG162A": &dto.FLXG162AReq{},
|
"FLXG162A": &dto.FLXG162AReq{},
|
||||||
"FLXG0687": &dto.FLXG0687Req{},
|
"FLXG0687": &dto.FLXG0687Req{},
|
||||||
"FLXG21": &dto.FLXG21Req{},
|
"FLXGBC21": &dto.FLXGBC21Req{},
|
||||||
"FLXG970F": &dto.FLXG970FReq{},
|
"FLXG970F": &dto.FLXG970FReq{},
|
||||||
"FLXG5876": &dto.FLXG5876Req{},
|
"FLXG5876": &dto.FLXG5876Req{},
|
||||||
"FLXG9687": &dto.FLXG9687Req{},
|
"FLXG9687": &dto.FLXG9687Req{},
|
||||||
@@ -134,20 +134,26 @@ func (s *FormConfigServiceImpl) getDTOStruct(apiCode string) interface{} {
|
|||||||
"DWBG6A2C": &dto.DWBG6A2CReq{},
|
"DWBG6A2C": &dto.DWBG6A2CReq{},
|
||||||
"DWBG8B4D": &dto.DWBG8B4DReq{},
|
"DWBG8B4D": &dto.DWBG8B4DReq{},
|
||||||
"FLXG8B4D": &dto.FLXG8B4DReq{},
|
"FLXG8B4D": &dto.FLXG8B4DReq{},
|
||||||
|
"IVYZ81NC": &dto.IVYZ81NCReq{},
|
||||||
|
"IVYZ7F3A": &dto.IVYZ7F3AReq{},
|
||||||
|
"IVYZ3A7F": &dto.IVYZ3A7FReq{},
|
||||||
|
"IVYZ9D2E": &dto.IVYZ9D2EReq{},
|
||||||
|
"DWBG7F3A": &dto.DWBG7F3AReq{},
|
||||||
|
"YYSY8F3A": &dto.YYSY8F3AReq{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// 优先返回已配置的DTO
|
// 优先返回已配置的DTO
|
||||||
if dto, exists := dtoMap[apiCode]; exists {
|
if dto, exists := dtoMap[apiCode]; exists {
|
||||||
return dto
|
return dto
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否为通用组合包(COMB开头且未单独配置)
|
// 检查是否为通用组合包(COMB开头且未单独配置)
|
||||||
if len(apiCode) >= 4 && apiCode[:4] == "COMB" {
|
if len(apiCode) >= 4 && apiCode[:4] == "COMB" {
|
||||||
// 对于通用组合包,返回一个通用的空结构体,表示无需特定参数验证
|
// 对于通用组合包,返回一个通用的空结构体,表示无需特定参数验证
|
||||||
// 因为组合包的参数验证由各个子处理器负责
|
// 因为组合包的参数验证由各个子处理器负责
|
||||||
return &struct{}{}
|
return &struct{}{}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
// ProcessFLXGBC21Request FLXGbc21 API处理方法
|
// ProcessFLXGBC21Request FLXGbc21 API处理方法
|
||||||
func ProcessFLXGBC21Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
func ProcessFLXGBC21Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||||
var paramsDto dto.FLXG21Req
|
var paramsDto dto.FLXGBC21Req
|
||||||
if err := json.Unmarshal(params, ¶msDto); err != nil {
|
if err := json.Unmarshal(params, ¶msDto); err != nil {
|
||||||
return nil, errors.Join(processors.ErrSystem, err)
|
return nil, errors.Join(processors.ErrSystem, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user