add
This commit is contained in:
@@ -374,6 +374,8 @@ func registerAllProcessors(combService *comb.CombService) {
|
||||
"IVYZX7J9": ivyz.ProcessIVYZX7J9Request, // 学历核验政务
|
||||
"IVYZFC59": ivyz.ProcessIVYZFC59Request, // 房产核验
|
||||
"IVYZGJ99": ivyz.ProcessIVYZGJ99Request, // 公积金核验
|
||||
"IVYZ2MN2": ivyz.ProcessIVYZ2MN2Request, // 学历核验
|
||||
"IVYZHY87": ivyz.ProcessIVYZHY87Request, // 婚姻状态查询
|
||||
|
||||
// COMB系列处理器 - 只注册有自定义逻辑的组合包
|
||||
"COMB86PM": comb.ProcessCOMB86PMRequest, // 有自定义逻辑:重命名ApiCode
|
||||
|
||||
@@ -344,6 +344,8 @@ func (s *FormConfigServiceImpl) getDTOStruct(ctx context.Context, apiCode string
|
||||
"IVYZFC59": &dto.IVYZFC59Req{}, //房产核验
|
||||
"IVYZGJ99": &dto.IVYZGJ99Req{}, //公积金核验
|
||||
"QCXG6U5G": &dto.QCXG6U5GReq{}, //名下车辆核验
|
||||
"IVYZ2MN2": &dto.IVYZ2MN2Req{}, //学历核验
|
||||
"IVYZHY87": &dto.IVYZHY87Req{}, //婚姻状态查询
|
||||
}
|
||||
|
||||
// 优先返回已配置的DTO
|
||||
@@ -578,6 +580,7 @@ func (s *FormConfigServiceImpl) generateFieldLabel(jsonTag string) string {
|
||||
"auth_authorize_file_base64": "PDF授权文件Base64编码(≤500KB,仅PDF)",
|
||||
"account_no": "企业账户",
|
||||
"account_bank": "开户行:如中国银行股份有限公司,查询失败请查看支持银行列表或使用主银行公司。",
|
||||
"educert_no": "学历证书编号",
|
||||
}
|
||||
|
||||
if label, exists := labelMap[jsonTag]; exists {
|
||||
@@ -646,6 +649,7 @@ func (s *FormConfigServiceImpl) generateExampleValue(fieldType reflect.Type, jso
|
||||
"auth_authorize_file_base64": "JVBERi0xLjQKJcTl8uXr...(示例PDF的Base64编码)",
|
||||
"account_no": "6222021234567890123",
|
||||
"account_bank": "中国工商银行",
|
||||
"educert_no": "1234567890",
|
||||
}
|
||||
|
||||
if example, exists := exampleMap[jsonTag]; exists {
|
||||
@@ -723,6 +727,7 @@ func (s *FormConfigServiceImpl) generatePlaceholder(jsonTag string, fieldType st
|
||||
"auth_authorize_file_base64": "请输入PDF文件的Base64编码字符串",
|
||||
"account_no": "请输入企业账户",
|
||||
"account_bank": "请输入开户行:如中国银行股份有限公司,查询失败请查看支持银行列表或使用主银行公司。",
|
||||
"educert_no": "请输入学历证书编号",
|
||||
}
|
||||
|
||||
if placeholder, exists := placeholderMap[jsonTag]; exists {
|
||||
@@ -802,6 +807,7 @@ func (s *FormConfigServiceImpl) generateDescription(jsonTag string, validation s
|
||||
"auth_authorize_file_base64": "请输入PDF文件的Base64编码字符串",
|
||||
"account_no": "请输入企业账户",
|
||||
"account_bank": "请输入开户行:如中国银行股份有限公司,查询失败请查看支持银行列表或使用主银行公司。",
|
||||
"educert_no": "请输入学历证书编号",
|
||||
}
|
||||
|
||||
if desc, exists := descMap[jsonTag]; exists {
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package ivyz
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"tyapi-server/internal/domains/api/dto"
|
||||
"tyapi-server/internal/domains/api/services/processors"
|
||||
"tyapi-server/internal/infrastructure/external/nuoer"
|
||||
)
|
||||
|
||||
// ProcessIVYZ2MN2Request IVYZ2MN2 API处理方法 - 学历核验a
|
||||
func ProcessIVYZ2MN2Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
var paramsDto dto.IVYZ2MN2Req
|
||||
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{
|
||||
"idCard": paramsDto.IDCard,
|
||||
"certNo": paramsDto.EducertNo,
|
||||
"name": paramsDto.Name,
|
||||
}
|
||||
|
||||
nuoerDoCheckAPIKey := "educationVerify"
|
||||
ApiPath := "/v1/doCheck"
|
||||
|
||||
resp, err := deps.NuoerService.CallAPI(ctx, nuoerDoCheckAPIKey, ApiPath, body)
|
||||
if err != nil {
|
||||
if errors.Is(err, nuoer.ErrNotFound) {
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
}
|
||||
if errors.Is(err, nuoer.ErrDatasource) {
|
||||
return nil, errors.Join(processors.ErrDatasource, 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
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package ivyz
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"tyapi-server/internal/domains/api/dto"
|
||||
"tyapi-server/internal/domains/api/services/processors"
|
||||
"tyapi-server/internal/infrastructure/external/nuoer"
|
||||
)
|
||||
|
||||
// ProcessIVYZHY87Request IVYZHY87 API处理方法 - 婚姻状态查询
|
||||
func ProcessIVYZHY87Request(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
|
||||
var paramsDto dto.IVYZHY87Req
|
||||
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{
|
||||
"idCard": paramsDto.IDCard,
|
||||
"name": paramsDto.Name,
|
||||
}
|
||||
|
||||
nuoerDoCheckAPIKey := "qualificateMarry"
|
||||
ApiPath := "/v1/doCheck"
|
||||
|
||||
resp, err := deps.NuoerService.CallAPI(ctx, nuoerDoCheckAPIKey, ApiPath, body)
|
||||
if err != nil {
|
||||
if errors.Is(err, nuoer.ErrNotFound) {
|
||||
return nil, errors.Join(processors.ErrNotFound, err)
|
||||
}
|
||||
if errors.Is(err, nuoer.ErrDatasource) {
|
||||
return nil, errors.Join(processors.ErrDatasource, 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
|
||||
}
|
||||
Reference in New Issue
Block a user