This commit is contained in:
2025-08-27 22:19:19 +08:00
parent 4031277a91
commit 5051aea55c
93 changed files with 2025 additions and 1168 deletions

View File

@@ -3,7 +3,7 @@ package comb
import (
"context"
"encoding/json"
"fmt"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
@@ -13,11 +13,11 @@ import (
func ProcessCOMB298YRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.COMB298YReq
if err := json.Unmarshal(params, &paramsDto); err != nil {
return nil, fmt.Errorf("%s: %w", processors.ErrSystem, err)
return nil, errors.Join(processors.ErrSystem, err)
}
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
return nil, fmt.Errorf("%s: %w", processors.ErrInvalidParam, err)
return nil, errors.Join(processors.ErrInvalidParam, err)
}
// 调用组合包服务处理请求

View File

@@ -3,7 +3,7 @@ package comb
import (
"context"
"encoding/json"
"fmt"
"errors"
"tyapi-server/internal/domains/api/dto"
"tyapi-server/internal/domains/api/services/processors"
@@ -13,11 +13,11 @@ import (
func ProcessCOMB86PMRequest(ctx context.Context, params []byte, deps *processors.ProcessorDependencies) ([]byte, error) {
var paramsDto dto.COMB86PMReq
if err := json.Unmarshal(params, &paramsDto); err != nil {
return nil, fmt.Errorf("%s: %w", processors.ErrSystem, err)
return nil, errors.Join(processors.ErrSystem, err)
}
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
return nil, fmt.Errorf("%s: %w", processors.ErrInvalidParam, err)
return nil, errors.Join(processors.ErrInvalidParam, err)
}
// 调用组合包服务处理请求