style: 修改聚合跟类命名

This commit is contained in:
橙子
2024-05-22 14:35:08 +08:00
parent f2e3c76539
commit 3429de9eb6
89 changed files with 446 additions and 412 deletions

View File

@@ -10,7 +10,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// 配置表
/// </summary>
[SugarTable("Config")]
public class ConfigEntity : Entity<Guid>, IAuditedObject, IOrderNum, ISoftDelete
public class ConfigAggregateRoot : AggregateRoot<Guid>, IAuditedObject, IOrderNum, ISoftDelete
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }

View File

@@ -10,15 +10,15 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// 部门表
///</summary>
[SugarTable("Dept")]
public class DeptEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
public class DeptAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
{
public DeptEntity()
public DeptAggregateRoot()
{
}
public DeptEntity(Guid Id) { this.Id = Id; ParentId = Guid.Empty; }
public DeptAggregateRoot(Guid Id) { this.Id = Id; ParentId = Guid.Empty; }
public DeptEntity(Guid Id, Guid parentId) { this.Id = Id; ParentId = parentId; }
public DeptAggregateRoot(Guid Id, Guid parentId) { this.Id = Id; ParentId = parentId; }
/// <summary>
/// 主键
/// </summary>

View File

@@ -10,7 +10,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
{
[SugarTable("LoginLog")]
[SugarIndex($"index_{nameof(LoginUser)}", nameof(LoginUser), OrderByType.Asc)]
public class LoginLogEntity : Entity<Guid>, ICreationAuditedObject
public class LoginLogAggregateRoot : AggregateRoot<Guid>, ICreationAuditedObject
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
@@ -50,7 +50,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
public Guid? CreatorId { get; set; }
public LoginLogEntity GetInfoByHttpContext(HttpContext context)
public LoginLogAggregateRoot GetInfoByHttpContext(HttpContext context)
{
ClientInfo GetClientInfo(HttpContext context)
{
@@ -78,7 +78,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
location = IpTool.Search(ipAddr);
}
ClientInfo clientInfo = GetClientInfo(context);
LoginLogEntity entity = new()
LoginLogAggregateRoot entity = new()
{
Browser = clientInfo.Device.Family,
Os = clientInfo.OS.ToString(),

View File

@@ -13,12 +13,12 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// 菜单表
///</summary>
[SugarTable("Menu")]
public partial class MenuEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
public partial class MenuAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
{
public MenuEntity() { }
public MenuAggregateRoot() { }
public MenuEntity(Guid id) { Id = id; ParentId = Guid.Empty; }
public MenuEntity(Guid id, Guid parentId) { Id = id; ParentId = parentId; }
public MenuAggregateRoot(Guid id) { Id = id; ParentId = Guid.Empty; }
public MenuAggregateRoot(Guid id, Guid parentId) { Id = id; ParentId = parentId; }
/// <summary>
/// 主键
/// </summary>
@@ -123,7 +123,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
public string? Query { get; set; }
[SugarColumn(IsIgnore = true)]
public List<MenuEntity>? Children { get; set; }
public List<MenuAggregateRoot>? Children { get; set; }
}
@@ -137,7 +137,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// </summary>
/// <param name="menus"></param>
/// <returns></returns>
public static List<Vue3RouterDto> Vue3RouterBuild(this List<MenuEntity> menus)
public static List<Vue3RouterDto> Vue3RouterBuild(this List<MenuAggregateRoot> menus)
{
menus = menus.Where(m => m.MenuType != MenuTypeEnum.Component).ToList();
List<Vue3RouterDto> routers = new();

View File

@@ -12,7 +12,7 @@ using Yi.Framework.Rbac.Domain.Shared.Enums;
namespace Yi.Framework.Rbac.Domain.Entities
{
[SugarTable("Notice")]
public class NoticeEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
public class NoticeAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
{
[SugarColumn(IsPrimaryKey = true)]

View File

@@ -10,7 +10,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// 岗位表
///</summary>
[SugarTable("Post")]
public class PostEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
public class PostAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
{
/// <summary>

View File

@@ -1,5 +1,4 @@
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
using Yi.Framework.Core.Data;
@@ -11,7 +10,7 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// 角色表
/// </summary>
[SugarTable("Role")]
public class RoleEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
public class RoleAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
{
/// <summary>
/// 主键
@@ -79,9 +78,9 @@ namespace Yi.Framework.Rbac.Domain.Entities
[Navigate(typeof(RoleMenuEntity), nameof(RoleMenuEntity.RoleId), nameof(RoleMenuEntity.MenuId))]
public List<MenuEntity>? Menus { get; set; }
public List<MenuAggregateRoot>? Menus { get; set; }
[Navigate(typeof(RoleDeptEntity), nameof(RoleDeptEntity.RoleId), nameof(RoleDeptEntity.DeptId))]
public List<DeptEntity>? Depts { get; set; }
public List<DeptAggregateRoot>? Depts { get; set; }
}
}

View File

@@ -1,5 +1,4 @@
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
using Yi.Framework.Core.Data;
@@ -14,13 +13,13 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// </summary>
[SugarTable("User")]
[SugarIndex($"index_{nameof(UserName)}", nameof(UserName), OrderByType.Asc)]
public class UserEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
public class UserAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject, IOrderNum, IState
{
public UserEntity()
public UserAggregateRoot()
{
}
public UserEntity(string userName, string password, long phone, string nick = "萌新")
public UserAggregateRoot(string userName, string password, long phone, string nick = "萌新")
{
UserName = userName;
EncryPassword.Password = password;
@@ -158,26 +157,26 @@ namespace Yi.Framework.Rbac.Domain.Entities
/// 角色
/// </summary>
[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))]
public List<RoleEntity> Roles { get; set; }
public List<RoleAggregateRoot> Roles { get; set; }
/// <summary>
/// 岗位
/// </summary>
[Navigate(typeof(UserPostEntity), nameof(UserPostEntity.UserId), nameof(UserPostEntity.PostId))]
public List<PostEntity> Posts { get; set; }
public List<PostAggregateRoot> Posts { get; set; }
/// <summary>
/// 部门
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(DeptId))]
public DeptEntity? Dept { get; set; }
public DeptAggregateRoot? Dept { get; set; }
/// <summary>
/// 构建密码MD5盐值加密
/// </summary>
public UserEntity BuildPassword(string password = null)
public UserAggregateRoot BuildPassword(string password = null)
{
//如果不传值那就把自己的password当作传进来的password
if (password == null)