feat: 优化rbac结构

This commit is contained in:
chenchun
2024-09-24 11:16:19 +08:00
parent 6359696bde
commit fd0edd93ea
23 changed files with 263 additions and 256 deletions

View File

@@ -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; }
}
}

View File

@@ -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;
}
}
}

View File

@@ -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);