feat: 优化rbac结构
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
using Volo.Abp.Domain.Entities;
|
||||
|
||||
namespace Yi.Framework.Rbac.Domain.Entities
|
||||
{
|
||||
public class StudentEntity : Entity<Guid>
|
||||
{
|
||||
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true)]
|
||||
public override Guid Id { get; protected set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.Domain.Entities.Events;
|
||||
using Volo.Abp.EventBus;
|
||||
using Yi.Framework.Rbac.Domain.Entities;
|
||||
|
||||
namespace Yi.Framework.Rbac.Domain.EventHandlers
|
||||
{
|
||||
public class StudentEventHandler : ILocalEventHandler<EntityCreatedEventData<StudentEntity>>, ITransientDependency
|
||||
{
|
||||
public Task HandleEventAsync(EntityCreatedEventData<StudentEntity> eventData)
|
||||
{
|
||||
Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(eventData.Entity));
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
||||
var isExist = await _repository.IsAnyAsync(x => x.UserName == userEntity.UserName);
|
||||
if (isExist)
|
||||
{
|
||||
throw new UserFriendlyException(UserConst.User_Exist);
|
||||
throw new UserFriendlyException(UserConst.Exist);
|
||||
}
|
||||
|
||||
var entity = await _repository.InsertReturnEntityAsync(userEntity);
|
||||
|
||||
Reference in New Issue
Block a user