add utils to pkg
CI / changes (push) Successful in 1s
CI / docker-bff (push) Successful in 1s
CI / docker-product (push) Failing after 1s

This commit is contained in:
2026-08-07 09:55:22 +08:00
parent 95d4c7bdc2
commit 10424d23d8
21 changed files with 410 additions and 1081 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ import (
"admin/internal/svc"
"github.com/zeromicro/go-zero/core/logx"
"pkg.local/utils"
validateService "pkg.local/validate"
)
@@ -27,8 +28,8 @@ func NewAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddLogic {
func (l *AddLogic) Add(in *admin.AddRequest) (*admin.Response, error) {
var req validator.AdminAddValidator
if resp := validateService.ValidateFromProto(in, &req); resp != "" {
return &admin.Response{Code: 111, Msg: resp}, nil
if resp := validateService.ValidateFromProto(in, &req); resp != utils.StringEmpty {
return &admin.Response{Code: utils.Ok.Code, Msg: resp}, nil
}
return &admin.Response{}, nil