feat: rbac完善,file接入完成

This commit is contained in:
Blizzard
2026-05-01 12:56:08 +08:00
parent bbd3f834b9
commit a93477ea8e
81 changed files with 5470 additions and 371 deletions
@@ -21,11 +21,21 @@ func NewCreateUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create
}
func (l *CreateUserLogic) CreateUser(req *types.UserCreateReq) error {
_, err := l.svcCtx.SystemRpc.CreateUser(l.ctx, &system.CreateUserReq{
resp, err := l.svcCtx.SystemRpc.CreateUser(l.ctx, &system.CreateUserReq{
Name: req.Name,
Account: req.Account,
Password: req.Password,
Phone: req.Phone,
})
if err != nil {
return err
}
// 创建完成后立即绑定角色
if len(req.RoleIds) > 0 && resp != nil {
_, err = l.svcCtx.SystemRpc.AssignUserRoles(l.ctx, &system.AssignUserRolesReq{
UserId: resp.User.Id,
RoleIds: req.RoleIds,
})
}
return err
}