add utils to pkg
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user