精简实体准备
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-08-15 23:53:25 +08:00
parent 0689f731b7
commit 3701d8bcd9
5 changed files with 83 additions and 79 deletions

View File

@ -17,4 +17,52 @@ namespace IRaCIS.Core.Domain.Models
abstract TKey Id { get; set; }
}
#region 减少实体属性,增加基类
public abstract class BaseAuditAddEntity : Entity, IAuditAdd
{
public Guid CreateUserId { get; set; }
public DateTime CreateTime { get; set; }
}
public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd
{
public Guid CreateUserId { get; set; }
public DateTime CreateTime { get; set; }
public Guid UpdateUserId { get; set; }
public DateTime UpdateTime { get; set; }
}
public abstract class BaseFullAuditDeleteEntity : Entity, IAuditUpdate, IAuditAdd, ISoftDelete
{
public Guid? DeleteUserId { get; set; }
public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
public Guid CreateUserId { get; set; }
public DateTime CreateTime { get; set; }
public Guid UpdateUserId { get; set; }
public DateTime UpdateTime { get; set; }
}
public abstract class BaseAuditAddEntityWithUserName : Entity, IAuditAddWithUserName
{
public string CreateUser { get; set; }
public Guid CreateUserId { get; set; }
public DateTime CreateTime { get; set; }
}
public abstract class BaseAuditUpdateEntity : Entity, IAuditUpdate
{
public Guid UpdateUserId { get; set; }
public DateTime UpdateTime { get; set; }
}
#endregion
}

View File

@ -19,7 +19,9 @@ namespace IRaCIS.Core.Domain.Models
public interface IAuditAddWithUserName : IAuditAdd<Guid>
{
string CreateUser { get; set; }
public string CreateUser { get; set; }
}
}

View File

@ -5,7 +5,6 @@ namespace IRaCIS.Core.Domain.Models
public interface IAuditUpdate<TKey> where TKey : struct
{
public TKey UpdateUserId { get; set; }
//string UpdateUserName { get; set; }
public DateTime UpdateTime { get; set; }
}
@ -13,4 +12,9 @@ namespace IRaCIS.Core.Domain.Models
{
}
}

View File

@ -2,16 +2,18 @@
namespace IRaCIS.Core.Domain.Models
{
public interface ISoftDelete
public interface ISoftDelete<TKey> where TKey : struct
{
bool IsDeleted { get; set; }
public TKey? DeleteUserId { get; set; }
public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
public Guid? DeleteUserId { get; set; }
}
public interface ISoftDelete : ISoftDelete<Guid>
{
}
}

View File

@ -9,82 +9,30 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace IRaCIS.Core.Domain.Models
{
///<summary>
///CommonDocument
///</summary>
[Table("CommonDocument")]
public class CommonDocument : Entity, IAuditUpdate, IAuditAdd,ISoftDelete
{
///<summary>
///CommonDocument
///</summary>
[Table("CommonDocument")]
public class CommonDocument : BaseFullAuditDeleteEntity
{
public string Code { get; set; } = String.Empty;
[Required]
public string Code { get; set; } = String.Empty;
public string Name { get; set; } = String.Empty;
[Required]
public string Name { get; set; } = String.Empty;
public string NameCN { get; set; } = string.Empty;
public string NameCN { get; set; } = string.Empty;
/// <summary>
/// Path
/// </summary>
[Required]
public string Path { get; set; } = String.Empty;
/// <summary>
/// CreateTime
/// </summary>
[Required]
public DateTime CreateTime { get; set; }
/// <summary>
/// CreateUserId
/// </summary>
[Required]
public Guid CreateUserId { get; set; }
/// <summary>
/// UpdateTime
/// </summary>
[Required]
public DateTime UpdateTime { get; set; }
/// <summary>
/// UpdateUserId
/// </summary>
[Required]
public Guid UpdateUserId { get; set; }
/// <summary>
/// Description
/// </summary>
[Required]
public string Description { get; set; } = String.Empty;
/// <summary>
/// IsDeleted
/// </summary>
[Required]
public bool IsDeleted { get; set; }
public DateTime? DeletedTime { get; set; }
public Guid? DeleteUserId { get; set; }
public string Path { get; set; } = String.Empty;
public CriterionType? CriterionTypeEnum { get; set; }
public CommonDocumentFileType FileTypeEnum { get; set; }
public EmailBusinessScenario BusinessScenarioEnum { get; set; }
public string Description { get; set; } = String.Empty;
public CriterionType? CriterionTypeEnum { get; set; }
public CommonDocumentFileType FileTypeEnum { get; set; }
public EmailBusinessScenario BusinessScenarioEnum { get; set; }
//[Required]
//public Guid FileTypeId { get; set; }
//public Guid ModuleTypeId { get; set; }
}
//public Dictionary FileType { get; set; }
//public Dictionary ModuleType { get; set; }
}
}
}