feat: rbac迁移完成,并已部署至dev服务器
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/system/api/internal/svc"
|
||||
"sundynix-micro-go/app/system/api/internal/types"
|
||||
"sundynix-micro-go/app/system/rpc/system"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CreateUserLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewCreateUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateUserLogic {
|
||||
return &CreateUserLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
|
||||
}
|
||||
|
||||
func (l *CreateUserLogic) CreateUser(req *types.UserCreateReq) error {
|
||||
_, err := l.svcCtx.SystemRpc.CreateUser(l.ctx, &system.CreateUserReq{
|
||||
Name: req.Name,
|
||||
Account: req.Account,
|
||||
Password: req.Password,
|
||||
Phone: req.Phone,
|
||||
})
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user