chore: 优化entity,统一表名,取消启动自动开启浏览器。

main
NoahLan 8 months ago
parent 45a9862edf
commit 9b5f19c02f

@ -1,33 +1,33 @@
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
public class OrganizationDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Code { get; set; } = string.Empty;
public string? Remark { get; set; }
/// <summary>
/// 负责人ID
/// </summary>
public Guid LeaderId { get; set; }
/// <summary>
/// 负责人名称,仅用户展示,不存储
/// </summary>
public string Leader { get; set; }
/// <summary>
/// 父节点 ID
/// </summary>
public Guid ParentId { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
public class OrganizationDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Code { get; set; } = string.Empty;
public string? Remark { get; set; }
/// <summary>
/// 负责人ID
/// </summary>
public Guid LeaderId { get; set; }
/// <summary>
/// 负责人名称,仅用户展示,不存储
/// </summary>
public string Leader { get; set; }
/// <summary>
/// 父节点 ID
/// </summary>
public Guid ParentId { get; set; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
}

@ -1,18 +1,18 @@
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
public class PostDto
{
public Guid Id { get; set; }
public string Code { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string? Remark { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
public class PostDto
{
public Guid Id { get; set; }
public string Code { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string? Remark { get; set; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
}

@ -1,29 +1,29 @@
using NPin.Framework.Upms.Domain.Shared.Enums;
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
public class RoleFullDto
{
public RoleDto Role { get; set; } = new();
// Relations
public HashSet<OrganizationDto> OrganizationList { get; set; } = [];
}
public class RoleDto
{
public Guid Id { get; set; }
public string Code { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public DataScopeEnum DataScope { get; set; } = DataScopeEnum.All;
public string? Remark { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
using NPin.Framework.Upms.Domain.Shared.Enums;
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
public class RoleFullDto
{
public RoleDto Role { get; set; } = new();
// Relations
public HashSet<OrganizationDto> OrganizationList { get; set; } = [];
}
public class RoleDto
{
public Guid Id { get; set; }
public string Code { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public DataScopeEnum DataScope { get; set; } = DataScopeEnum.All;
public string? Remark { get; set; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
}

@ -1,51 +1,51 @@
using NPin.Framework.Upms.Domain.Shared.Enums;
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
/// <summary>
/// 完整用户信息Dto
/// 包括所有关联关系
/// </summary>
public class UserFullDto
{
public UserDto User { get; set; } = new();
// Relations
public HashSet<RoleDto> Roles { get; set; } = [];
public HashSet<PostDto> Posts { get; set; } = [];
public HashSet<OrganizationDto> Organizations { get; set; } = [];
public HashSet<string> PostCodes { get; set; } = [];
public HashSet<string> RoleCodes { get; set; } = [];
public HashSet<string> PermissionCodes { get; set; } = [];
}
public class UserDto
{
/// <summary>
/// 主键ID
/// </summary>
public Guid Id { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public bool IsEnabled { get; set; }
public int OrderNum { get; set; }
public string Username { get; set; } = string.Empty;
public string PhoneNumber { get; set; }
public string? Email { get; set; }
public string? Nickname { get; set; }
public string Password { get; set; } = string.Empty;
public string Salt { get; set; } = string.Empty;
public string? Introduction { get; set; }
public GenderEnum Gender { get; set; } = GenderEnum.Secrecy;
public string? IpAddr { get; set; }
public string? Avatar { get; set; }
// For user (metadata)
public Dictionary<string, string> Metadata { get; set; }
using NPin.Framework.Upms.Domain.Shared.Enums;
namespace NPin.Framework.Upms.Domain.Shared.Dtos;
/// <summary>
/// 完整用户信息Dto
/// 包括所有关联关系
/// </summary>
public class UserFullDto
{
public UserDto User { get; set; } = new();
// Relations
public HashSet<RoleDto> Roles { get; set; } = [];
public HashSet<PostDto> Posts { get; set; } = [];
public HashSet<OrganizationDto> Organizations { get; set; } = [];
public HashSet<string> PostCodes { get; set; } = [];
public HashSet<string> RoleCodes { get; set; } = [];
public HashSet<string> PermissionCodes { get; set; } = [];
}
public class UserDto
{
/// <summary>
/// 主键ID
/// </summary>
public Guid Id { get; set; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
public bool IsEnabled { get; set; }
public int OrderNum { get; set; }
public string Username { get; set; } = string.Empty;
public string PhoneNumber { get; set; }
public string? Email { get; set; }
public string? Nickname { get; set; }
public string Password { get; set; } = string.Empty;
public string Salt { get; set; } = string.Empty;
public string? Introduction { get; set; }
public GenderEnum Gender { get; set; } = GenderEnum.Secrecy;
public string? IpAddr { get; set; }
public string? Avatar { get; set; }
// For user (metadata)
public Dictionary<string, string> Metadata { get; set; }
}

@ -1,22 +1,22 @@
using Microsoft.Extensions.DependencyInjection;
using NPin.Framework.Mapster;
using NPin.Framework.Upms.Domain.Shared.Options;
using Volo.Abp.Domain;
namespace NPin.Framework.Upms.Domain.Shared;
[DependsOn(
typeof(AbpDddDomainSharedModule),
typeof(NPinFrameworkMapsterModule)
)]
public class NPinFrameworkUpmsDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
// 配置文件读取
Configure<JwtOptions>(configuration.GetSection(nameof(JwtOptions)));
Configure<RefreshJwtOptions>(configuration.GetSection(nameof(RefreshJwtOptions)));
Configure<UpmsOptions>(configuration.GetSection(nameof(UpmsOptions)));
}
using Microsoft.Extensions.DependencyInjection;
using NPin.Framework.Mapster;
using NPin.Framework.Upms.Domain.Shared.Options;
using Volo.Abp.Domain;
namespace NPin.Framework.Upms.Domain.Shared;
[DependsOn(
typeof(AbpDddDomainSharedModule),
typeof(NPinFrameworkMapsterModule)
)]
public class NPinFrameworkUpmsDomainSharedModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
// 配置文件读取
Configure<JwtOptions>(configuration.GetSection(nameof(JwtOptions)));
Configure<RefreshJwtOptions>(configuration.GetSection(nameof(RefreshJwtOptions)));
Configure<UpmsOptions>(configuration.GetSection(nameof(UpmsOptions)));
}
}

@ -22,11 +22,11 @@ public class AnnouncementEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOr
[SugarColumn(ColumnDescription = "公告内容", ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string Content { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; }
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
}

@ -26,9 +26,9 @@ public class ConfigEntity : Entity<Guid>, IEnabled, IOrderNum, ISoftDelete, IAud
public bool IsEnabled { get; set; }
public int OrderNum { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; }
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
}

@ -23,10 +23,10 @@ public class FileAggregateRoot : AggregateRoot<Guid>, IAuditedObject
[SugarColumn(ColumnDescription = "文件路径")]
public string FilePath { get; set; }
public DateTime CreationTime { get; }
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
[SugarColumn(IsIgnore = true)] public override ExtraPropertyDictionary ExtraProperties { get; protected set; }

@ -16,8 +16,8 @@ public class LoginLogEntity : Entity<Guid>, ICreationAuditedObject
{
[SugarColumn(IsPrimaryKey = true)] public override Guid Id { get; protected set; }
public DateTime CreationTime { get; }
public Guid? CreatorId { get; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
[SugarColumn(ColumnDescription = "登录用户")]
public string? LoginUser { get; set; }
@ -61,7 +61,7 @@ public class LoginLogEntity : Entity<Guid>, ICreationAuditedObject
break;
}
}
var location = IPAddress.IsLoopback(ipAddr)
? new IpInfo { Province = "本地", City = "本机" }
: IpTool.Search(ipAddr.ToString());

@ -36,11 +36,11 @@ public class OrganizationEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOr
/// </summary>
public Guid ParentId { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
}

@ -20,11 +20,11 @@ public class PostEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum,
[SugarColumn(ColumnDescription = "岗位描述")]
public string? Remark { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public bool IsDeleted { get; set;}
public DateTime CreationTime { get; set;} = DateTime.Now;
public Guid? CreatorId { get; set;}
public DateTime? LastModificationTime { get; set;}
public Guid? LastModifierId { get; set;}
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }
}

@ -24,11 +24,11 @@ public class RoleEntity : Entity<Guid>, ISoftDelete, IAuditedObject, IOrderNum,
[SugarColumn(ColumnDescription = "描述")]
public string? Remark { get; set; }
public bool IsDeleted { get; }
public DateTime CreationTime { get; } = DateTime.Now;
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public bool IsDeleted { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
public int OrderNum { get; set; }
public bool IsEnabled { get; set; }

@ -17,8 +17,8 @@ public class UserMetaEntity : Entity<Guid>, IAuditedObject
[SugarColumn(ColumnDescription = "元数据 值")]
public string Value { get; set; }
public DateTime CreationTime { get; }
public Guid? CreatorId { get; }
public DateTime? LastModificationTime { get; }
public Guid? LastModifierId { get; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; set; }
}

@ -45,8 +45,8 @@ public class OperationLogEntity : Entity<Guid>, ICreationAuditedObject
[SugarColumn(ColumnDescription = "请求结果", Length = 9999)]
public string? RequestResult { get; set; }
public DateTime CreationTime { get; }
public Guid? CreatorId { get; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public static OperationLogEntity GetInfoByHttpContext(HttpContext httpContext)
{

@ -3,7 +3,7 @@
"profiles": {
"NPin.Web": {
"commandName": "Project",
"launchBrowser": true,
"launchBrowser": false,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"

Loading…
Cancel
Save