style: 修改聚合跟类命名
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
/// <summary>
|
||||
/// Dept服务实现
|
||||
/// </summary>
|
||||
public class DeptService : YiCrudAppService<DeptEntity, DeptGetOutputDto, DeptGetListOutputDto, Guid, DeptGetListInputVo, DeptCreateInputVo, DeptUpdateInputVo>, IDeptService
|
||||
public class DeptService : YiCrudAppService<DeptAggregateRoot, DeptGetOutputDto, DeptGetListOutputDto, Guid, DeptGetListInputVo, DeptCreateInputVo, DeptUpdateInputVo>, IDeptService
|
||||
{
|
||||
private IDeptRepository _deptRepository;
|
||||
public DeptService(IDeptRepository deptRepository) : base(deptRepository)
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
/// <summary>
|
||||
/// Menu服务实现
|
||||
/// </summary>
|
||||
public class MenuService : YiCrudAppService<MenuEntity, MenuGetOutputDto, MenuGetListOutputDto, Guid, MenuGetListInputVo, MenuCreateInputVo, MenuUpdateInputVo>,
|
||||
public class MenuService : YiCrudAppService<MenuAggregateRoot, MenuGetOutputDto, MenuGetListOutputDto, Guid, MenuGetListInputVo, MenuCreateInputVo, MenuUpdateInputVo>,
|
||||
IMenuService
|
||||
{
|
||||
private readonly ISqlSugarRepository<MenuEntity, Guid> _repository;
|
||||
public MenuService(ISqlSugarRepository<MenuEntity, Guid> repository) : base(repository)
|
||||
private readonly ISqlSugarRepository<MenuAggregateRoot, Guid> _repository;
|
||||
public MenuService(ISqlSugarRepository<MenuAggregateRoot, Guid> repository) : base(repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
/// <summary>
|
||||
/// Post服务实现
|
||||
/// </summary>
|
||||
public class PostService : YiCrudAppService<PostEntity, PostGetOutputDto, PostGetListOutputDto, Guid, PostGetListInputVo, PostCreateInputVo, PostUpdateInputVo>,
|
||||
public class PostService : YiCrudAppService<PostAggregateRoot, PostGetOutputDto, PostGetListOutputDto, Guid, PostGetListInputVo, PostCreateInputVo, PostUpdateInputVo>,
|
||||
IPostService
|
||||
{
|
||||
private readonly ISqlSugarRepository<PostEntity, Guid> _repository;
|
||||
public PostService(ISqlSugarRepository<PostEntity, Guid> repository) : base(repository)
|
||||
private readonly ISqlSugarRepository<PostAggregateRoot, Guid> _repository;
|
||||
public PostService(ISqlSugarRepository<PostAggregateRoot, Guid> repository) : base(repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
@@ -19,16 +19,16 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
/// <summary>
|
||||
/// Role服务实现
|
||||
/// </summary>
|
||||
public class RoleService : YiCrudAppService<RoleEntity, RoleGetOutputDto, RoleGetListOutputDto, Guid, RoleGetListInputVo, RoleCreateInputVo, RoleUpdateInputVo>,
|
||||
public class RoleService : YiCrudAppService<RoleAggregateRoot, RoleGetOutputDto, RoleGetListOutputDto, Guid, RoleGetListInputVo, RoleCreateInputVo, RoleUpdateInputVo>,
|
||||
IRoleService
|
||||
{
|
||||
public RoleService(RoleManager roleManager, ISqlSugarRepository<RoleDeptEntity> roleDeptRepository, ISqlSugarRepository<UserRoleEntity> userRoleRepository, ISqlSugarRepository<RoleEntity, Guid> repository) : base(repository)
|
||||
public RoleService(RoleManager roleManager, ISqlSugarRepository<RoleDeptEntity> roleDeptRepository, ISqlSugarRepository<UserRoleEntity> userRoleRepository, ISqlSugarRepository<RoleAggregateRoot, Guid> repository) : base(repository)
|
||||
{
|
||||
(_roleManager, _roleDeptRepository, _userRoleRepository, _repository) =
|
||||
(roleManager, roleDeptRepository, userRoleRepository, repository);
|
||||
}
|
||||
|
||||
private ISqlSugarRepository<RoleEntity, Guid> _repository;
|
||||
private ISqlSugarRepository<RoleAggregateRoot, Guid> _repository;
|
||||
private RoleManager _roleManager { get; set; }
|
||||
|
||||
private ISqlSugarRepository<RoleDeptEntity> _roleDeptRepository;
|
||||
@@ -44,7 +44,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
var insertEntities = input.DeptIds.Select(x => new RoleDeptEntity { DeptId = x, RoleId = input.RoleId }).ToList();
|
||||
await _roleDeptRepository.InsertRangeAsync(insertEntities);
|
||||
}
|
||||
var entity = new RoleEntity() { DataScope = input.DataScope };
|
||||
var entity = new RoleAggregateRoot() { DataScope = input.DataScope };
|
||||
EntityHelper.TrySetId(entity, () => input.RoleId);
|
||||
await _repository._Db.Updateable(entity).UpdateColumns(x => x.DataScope).ExecuteCommandAsync();
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
{
|
||||
RefAsync<int> total = 0;
|
||||
var output = await _userRoleRepository._DbQueryable
|
||||
.LeftJoin<UserEntity>((ur, u) => ur.UserId == u.Id && ur.RoleId == roleId)
|
||||
.LeftJoin<UserAggregateRoot>((ur, u) => ur.UserId == u.Id && ur.RoleId == roleId)
|
||||
.Where((ur, u) => ur.RoleId == roleId)
|
||||
.WhereIF(!string.IsNullOrEmpty(input.UserName), (ur, u) => u.UserName.Contains(input.UserName))
|
||||
.WhereIF(input.Phone is not null, (ur, u) => u.Phone.ToString().Contains(input.Phone.ToString()))
|
||||
@@ -166,7 +166,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
private async Task<PagedResultDto<UserGetListOutputDto>> GetNotAllocatedAuthUserByRoleIdAsync(Guid roleId, RoleAuthUserGetListInput input)
|
||||
{
|
||||
RefAsync<int> total = 0;
|
||||
var entities = await _userRoleRepository._Db.Queryable<UserEntity>()
|
||||
var entities = await _userRoleRepository._Db.Queryable<UserAggregateRoot>()
|
||||
.Where(u => SqlFunc.Subqueryable<UserRoleEntity>().Where(x => x.RoleId == roleId).Where(x => x.UserId == u.Id).NotAny())
|
||||
.WhereIF(!string.IsNullOrEmpty(input.UserName), u => u.UserName.Contains(input.UserName))
|
||||
.WhereIF(input.Phone is not null, u => u.Phone.ToString().Contains(input.Phone.ToString()))
|
||||
|
||||
@@ -24,15 +24,15 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
/// <summary>
|
||||
/// User服务实现
|
||||
/// </summary>
|
||||
public class UserService : YiCrudAppService<UserEntity, UserGetOutputDto, UserGetListOutputDto, Guid, UserGetListInputVo, UserCreateInputVo, UserUpdateInputVo>, IUserService
|
||||
public class UserService : YiCrudAppService<UserAggregateRoot, UserGetOutputDto, UserGetListOutputDto, Guid, UserGetListInputVo, UserCreateInputVo, UserUpdateInputVo>, IUserService
|
||||
//IUserService
|
||||
{
|
||||
public UserService(ISqlSugarRepository<UserEntity, Guid> repository, UserManager userManager, IUserRepository userRepository, ICurrentUser currentUser, IDeptService deptService, ILocalEventBus localEventBus, IDistributedCache<UserInfoCacheItem, UserInfoCacheKey> userCache) : base(repository)
|
||||
public UserService(ISqlSugarRepository<UserAggregateRoot, Guid> repository, UserManager userManager, IUserRepository userRepository, ICurrentUser currentUser, IDeptService deptService, ILocalEventBus localEventBus, IDistributedCache<UserInfoCacheItem, UserInfoCacheKey> userCache) : base(repository)
|
||||
=>
|
||||
(_userManager, _userRepository, _currentUser, _deptService, _repository, _localEventBus) =
|
||||
(userManager, userRepository, currentUser, deptService, repository, localEventBus);
|
||||
private UserManager _userManager { get; set; }
|
||||
private ISqlSugarRepository<UserEntity, Guid> _repository;
|
||||
private ISqlSugarRepository<UserAggregateRoot, Guid> _repository;
|
||||
private IUserRepository _userRepository { get; set; }
|
||||
private IDeptService _deptService { get; set; }
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
.WhereIF(ids is not null, x => ids.Contains(x.Id))
|
||||
|
||||
|
||||
.LeftJoin<DeptEntity>((user, dept) => user.DeptId == dept.Id)
|
||||
.LeftJoin<DeptAggregateRoot>((user, dept) => user.DeptId == dept.Id)
|
||||
.OrderByDescending(user => user.CreationTime)
|
||||
.Select((user, dept) => new UserGetListOutputDto(), true)
|
||||
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
|
||||
@@ -80,7 +80,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
}
|
||||
|
||||
|
||||
protected override UserEntity MapToEntity(UserCreateInputVo createInput)
|
||||
protected override UserAggregateRoot MapToEntity(UserCreateInputVo createInput)
|
||||
{
|
||||
var output = base.MapToEntity(createInput);
|
||||
output.EncryPassword = new Domain.Entities.ValueObjects.EncryPasswordValueObject(createInput.Password);
|
||||
@@ -107,7 +107,7 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
return result;
|
||||
}
|
||||
|
||||
protected override async Task<UserEntity> MapToEntityAsync(UserCreateInputVo createInput)
|
||||
protected override async Task<UserAggregateRoot> MapToEntityAsync(UserCreateInputVo createInput)
|
||||
{
|
||||
var entitiy = await base.MapToEntityAsync(createInput);
|
||||
entitiy.BuildPassword();
|
||||
|
||||
Reference in New Issue
Block a user