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

main
NoahLan 8 months ago
parent 45a9862edf
commit 9b5f19c02f

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

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

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

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

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

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

@ -23,10 +23,10 @@ public class FileAggregateRoot : AggregateRoot<Guid>, IAuditedObject
[SugarColumn(ColumnDescription = "文件路径")] [SugarColumn(ColumnDescription = "文件路径")]
public string FilePath { get; set; } public string FilePath { get; set; }
public DateTime CreationTime { get; } public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; } public Guid? CreatorId { get; set; }
public DateTime? LastModificationTime { get; } public DateTime? LastModificationTime { get; set; }
public Guid? LastModifierId { get; } public Guid? LastModifierId { get; set; }
[SugarColumn(IsIgnore = true)] public override ExtraPropertyDictionary ExtraProperties { get; protected 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; } [SugarColumn(IsPrimaryKey = true)] public override Guid Id { get; protected set; }
public DateTime CreationTime { get; } public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; } public Guid? CreatorId { get; set; }
[SugarColumn(ColumnDescription = "登录用户")] [SugarColumn(ColumnDescription = "登录用户")]
public string? LoginUser { get; set; } public string? LoginUser { get; set; }
@ -61,7 +61,7 @@ public class LoginLogEntity : Entity<Guid>, ICreationAuditedObject
break; break;
} }
} }
var location = IPAddress.IsLoopback(ipAddr) var location = IPAddress.IsLoopback(ipAddr)
? new IpInfo { Province = "本地", City = "本机" } ? new IpInfo { Province = "本地", City = "本机" }
: IpTool.Search(ipAddr.ToString()); : IpTool.Search(ipAddr.ToString());

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

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

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

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

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

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

Loading…
Cancel
Save