This commit is contained in:
2025-10-16 18:46:44 +08:00
parent 5a6e95906c
commit b05d694755
3 changed files with 12 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ type FLXG162AReq struct {
type FLXG0687Req struct {
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"`
}
type FLXG970FReq struct {

View File

@@ -20,7 +20,7 @@ type FormField struct {
// FormConfig 表单配置
type FormConfig struct {
ApiCode string `json:"api_code"`
ApiCode string `json:"api_code"`
Fields []FormField `json:"fields"`
}
@@ -70,7 +70,7 @@ func (s *FormConfigServiceImpl) getDTOStruct(apiCode string) interface{} {
"FLXG54F5": &dto.FLXG54F5Req{},
"FLXG162A": &dto.FLXG162AReq{},
"FLXG0687": &dto.FLXG0687Req{},
"FLXG21": &dto.FLXG21Req{},
"FLXGBC21": &dto.FLXGBC21Req{},
"FLXG970F": &dto.FLXG970FReq{},
"FLXG5876": &dto.FLXG5876Req{},
"FLXG9687": &dto.FLXG9687Req{},
@@ -134,20 +134,26 @@ func (s *FormConfigServiceImpl) getDTOStruct(apiCode string) interface{} {
"DWBG6A2C": &dto.DWBG6A2CReq{},
"DWBG8B4D": &dto.DWBG8B4DReq{},
"FLXG8B4D": &dto.FLXG8B4DReq{},
"IVYZ81NC": &dto.IVYZ81NCReq{},
"IVYZ7F3A": &dto.IVYZ7F3AReq{},
"IVYZ3A7F": &dto.IVYZ3A7FReq{},
"IVYZ9D2E": &dto.IVYZ9D2EReq{},
"DWBG7F3A": &dto.DWBG7F3AReq{},
"YYSY8F3A": &dto.YYSY8F3AReq{},
}
// 优先返回已配置的DTO
if dto, exists := dtoMap[apiCode]; exists {
return dto
}
// 检查是否为通用组合包COMB开头且未单独配置
if len(apiCode) >= 4 && apiCode[:4] == "COMB" {
// 对于通用组合包,返回一个通用的空结构体,表示无需特定参数验证
// 因为组合包的参数验证由各个子处理器负责
return &struct{}{}
}
return nil
}

View File

@@ -12,7 +12,7 @@ import (
// ProcessFLXGBC21Request FLXGbc21 API处理方法
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, &paramsDto); err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}