From 1c1761d54822e8bc89744e8e4e5c9d22db4a461d Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期二, 09 九月 2025 15:29:40 +0800 Subject: [PATCH] feat:开发 --- FlexJobApi.Core/Entities/CommonEntity.cs | 57 ++++++++++++++++++++++++++------------------------------- 1 files changed, 26 insertions(+), 31 deletions(-) diff --git a/FlexJobApi.Core/Entities/CommonEntity.cs b/FlexJobApi.Core/Entities/CommonEntity.cs index 1728392..4506b19 100644 --- a/FlexJobApi.Core/Entities/CommonEntity.cs +++ b/FlexJobApi.Core/Entities/CommonEntity.cs @@ -2,48 +2,33 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FlexJobApi.Core { - public abstract class CommonEntity<TDbContextLocator1> : Entity<Guid, TDbContextLocator1>, IPrivateEntity + public abstract class CommonEntity<TDbContextLocator1, TDbContextLocator2> : CommonEntity, IPrivateEntity where TDbContextLocator1 : class, IDbContextLocator + where TDbContextLocator2 : class, IDbContextLocator { - /// <summary> - /// 鎺掑簭 - /// </summary> - public virtual int Sort { get; set; } - - /// <summary> - /// 璺熻釜Id - /// </summary> - public virtual string TraceId { get; set; } - - /// <summary> - /// 鍒涘缓鎿嶄綔浜� - /// </summary> - public virtual Guid? CreatedUserId { get; set; } - - /// <summary> - /// 鍒涘缓浼佷笟Id - /// </summary> - public virtual Guid? CreatedEnterpriseId { get; set; } - - /// <summary> - /// 鏈�鍚庢洿鏂版搷浣滀汉 - /// </summary> - public virtual Guid? UpdatedUserId { get; set; } - - /// <summary> - /// 鏄惁鍒犻櫎 - /// </summary> - public virtual bool IsDeleted { get; set; } } - public abstract class CommonEntity : Entity<Guid>, IPrivateEntity + public abstract class CommonEntity<TDbContextLocator1> : CommonEntity, IPrivateEntity + where TDbContextLocator1 : class, IDbContextLocator { + } + + public abstract class CommonEntity : PrivateEntity<Guid>, IPrivateEntity + { + /// <summary> + /// 涓婚敭Id + /// </summary> + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public override Guid Id { get; set; } + /// <summary> /// 鎺掑簭 /// </summary> @@ -55,6 +40,11 @@ public virtual string TraceId { get; set; } /// <summary> + /// 鍒涘缓鏃堕棿 + /// </summary> + public override DateTimeOffset CreatedTime { get; set; } + + /// <summary> /// 鍒涘缓鎿嶄綔浜� /// </summary> public virtual Guid? CreatedUserId { get; set; } @@ -65,6 +55,11 @@ public virtual Guid? CreatedEnterpriseId { get; set; } /// <summary> + /// 鏈�鍚庢洿鏂版椂闂� + /// </summary> + public override DateTimeOffset? UpdatedTime { get; set; } + + /// <summary> /// 鏈�鍚庢洿鏂版搷浣滀汉 /// </summary> public virtual Guid? UpdatedUserId { get; set; } -- Gitblit v1.9.1