This commit is contained in:
2026-06-27 23:56:18 +08:00
parent 15a8571628
commit 30a24aab68
10 changed files with 813 additions and 28 deletions

View File

@@ -425,6 +425,9 @@ func (s *ApiApplicationServiceImpl) callExternalApi(ctx context.Context, cmd *co
zap.String("error_type", mappedErrorType),
zap.Error(err))
if errors.Is(err, processors.ErrContactBusiness) {
return "", ErrContactBusiness
}
if mappedErrorType == entities.ApiCallErrorInvalidParam {
return "", ErrInvalidParam
}

View File

@@ -25,6 +25,7 @@ var (
ErrSubscriptionExpired = errors.New("订阅已过期")
ErrSubscriptionSuspended = errors.New("订阅已暂停")
ErrBusiness = errors.New("业务失败")
ErrContactBusiness = errors.New("请联系商务咨询")
ErrSubordinateLinkNotFound = errors.New("非子账号无法使用master_accessid")
ErrSubordinateParentMismatch = errors.New("master_accessid与主账号不匹配")
ErrMissingMgmtKey = errors.New("缺少管理密钥")
@@ -55,6 +56,7 @@ var ErrorCodeMap = map[error]int{
ErrSubscriptionExpired: 1008,
ErrSubscriptionSuspended: 1008,
ErrBusiness: 2001,
ErrContactBusiness: 2001,
ErrSubordinateLinkNotFound: 1301,
ErrSubordinateParentMismatch: 1302,
ErrMissingMgmtKey: 1010,

View File

@@ -4,8 +4,9 @@ import "errors"
// 处理器相关错误类型
var (
ErrDatasource = errors.New("数据源异常")
ErrSystem = errors.New("系统异常")
ErrInvalidParam = errors.New("参数校验不正确")
ErrNotFound = errors.New("查询为空")
ErrDatasource = errors.New("数据源异常")
ErrSystem = errors.New("系统异常")
ErrInvalidParam = errors.New("参数校验不正确")
ErrNotFound = errors.New("查询为空")
ErrContactBusiness = errors.New("请联系商务咨询")
)

View File

@@ -21,12 +21,7 @@ func ProcessIVYZ18HYRequest(ctx context.Context, params []byte, deps *processors
return nil, errors.Join(processors.ErrInvalidParam, err)
}
fixedData := map[string]interface{}{"msg": "请联系商务咨询"}
fixedRespBytes, err := json.Marshal(fixedData)
if err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
return fixedRespBytes, nil
return nil, processors.ErrContactBusiness
authDate := ""
if len(paramsDto.AuthDate) >= 8 {

View File

@@ -21,12 +21,7 @@ func ProcessIVYZ28HYRequest(ctx context.Context, params []byte, deps *processors
return nil, errors.Join(processors.ErrInvalidParam, err)
}
fixedData := map[string]interface{}{"msg": "请联系商务咨询"}
fixedRespBytes, err := json.Marshal(fixedData)
if err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
return fixedRespBytes, nil
return nil, processors.ErrContactBusiness
reqParams := map[string]interface{}{
"key": "",

View File

@@ -21,12 +21,7 @@ func ProcessIVYZ38SRRequest(ctx context.Context, params []byte, deps *processors
return nil, errors.Join(processors.ErrInvalidParam, err)
}
fixedData := map[string]interface{}{"msg": "请联系商务咨询"}
fixedRespBytes, err := json.Marshal(fixedData)
if err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
return fixedRespBytes, nil
return nil, processors.ErrContactBusiness
reqParams := map[string]interface{}{
"key": "",

View File

@@ -21,12 +21,7 @@ func ProcessIVYZ48SRRequest(ctx context.Context, params []byte, deps *processors
return nil, errors.Join(processors.ErrInvalidParam, err)
}
fixedData := map[string]interface{}{"msg": "请联系商务咨询"}
fixedRespBytes, err := json.Marshal(fixedData)
if err != nil {
return nil, errors.Join(processors.ErrSystem, err)
}
return fixedRespBytes, nil
return nil, processors.ErrContactBusiness
reqParams := map[string]interface{}{
"key": "",