添加项目文件。
This commit is contained in:
18
HT.Cloud.Domain/Entity/IBaseEntity/ICreationAudited.cs
Normal file
18
HT.Cloud.Domain/Entity/IBaseEntity/ICreationAudited.cs
Normal file
@ -0,0 +1,18 @@
|
||||
/*******************************************************************************
|
||||
* Copyright © 2020 HT.Cloud.Framework 版权所有
|
||||
* Author: HT.Cloud
|
||||
* Description: WaterCloud快速开发平台
|
||||
* Website:
|
||||
*********************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace HT.Cloud.Domain
|
||||
{
|
||||
public interface ICreationAudited
|
||||
{
|
||||
string F_Id { get; set; }
|
||||
string F_CreatorUserId { get; set; }
|
||||
DateTime? F_CreatorTime { get; set; }
|
||||
}
|
||||
}
|
29
HT.Cloud.Domain/Entity/IBaseEntity/IDeleteAudited.cs
Normal file
29
HT.Cloud.Domain/Entity/IBaseEntity/IDeleteAudited.cs
Normal file
@ -0,0 +1,29 @@
|
||||
/*******************************************************************************
|
||||
* Copyright © 2020 HT.Cloud.Framework 版权所有
|
||||
* Author: HT.Cloud
|
||||
* Description: WaterCloud快速开发平台
|
||||
* Website:
|
||||
*********************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace HT.Cloud.Domain
|
||||
{
|
||||
public interface IDeleteAudited
|
||||
{
|
||||
/// <summary>
|
||||
/// 逻辑删除标记
|
||||
/// </summary>
|
||||
bool? F_DeleteMark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除实体的用户
|
||||
/// </summary>
|
||||
string F_DeleteUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除实体时间
|
||||
/// </summary>
|
||||
DateTime? F_DeleteTime { get; set; }
|
||||
}
|
||||
}
|
51
HT.Cloud.Domain/Entity/IBaseEntity/IEntity.cs
Normal file
51
HT.Cloud.Domain/Entity/IBaseEntity/IEntity.cs
Normal file
@ -0,0 +1,51 @@
|
||||
/*******************************************************************************
|
||||
* Copyright © 2020 HT.Cloud.Framework 版权所有
|
||||
* Author: HT.Cloud
|
||||
* Description: WaterCloud快速开发平台
|
||||
* Website:
|
||||
*********************************************************************************/
|
||||
|
||||
using System;
|
||||
using HT.Cloud.Code;
|
||||
|
||||
namespace HT.Cloud.Domain
|
||||
{
|
||||
public class IEntity<TEntity>
|
||||
{
|
||||
public void Create()
|
||||
{
|
||||
var entity = this as ICreationAudited;
|
||||
entity.F_Id = Utils.GuId();
|
||||
var LoginInfo = OperatorProvider.Provider.GetCurrent();
|
||||
if (LoginInfo != null)
|
||||
{
|
||||
entity.F_CreatorUserId = LoginInfo.UserId;
|
||||
}
|
||||
entity.F_CreatorTime = DateTime.Now;
|
||||
}
|
||||
|
||||
public void Modify(string keyValue)
|
||||
{
|
||||
var entity = this as IModificationAudited;
|
||||
entity.F_Id = keyValue;
|
||||
var LoginInfo = OperatorProvider.Provider.GetCurrent();
|
||||
if (LoginInfo != null)
|
||||
{
|
||||
entity.F_LastModifyUserId = LoginInfo.UserId;
|
||||
}
|
||||
entity.F_LastModifyTime = DateTime.Now;
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
var entity = this as IDeleteAudited;
|
||||
var LoginInfo = OperatorProvider.Provider.GetCurrent();
|
||||
if (LoginInfo != null)
|
||||
{
|
||||
entity.F_DeleteUserId = LoginInfo.UserId;
|
||||
}
|
||||
entity.F_DeleteTime = DateTime.Now;
|
||||
entity.F_DeleteMark = true;
|
||||
}
|
||||
}
|
||||
}
|
18
HT.Cloud.Domain/Entity/IBaseEntity/IModificationAudited.cs
Normal file
18
HT.Cloud.Domain/Entity/IBaseEntity/IModificationAudited.cs
Normal file
@ -0,0 +1,18 @@
|
||||
/*******************************************************************************
|
||||
* Copyright © 2020 HT.Cloud.Framework 版权所有
|
||||
* Author: HT.Cloud
|
||||
* Description: WaterCloud快速开发平台
|
||||
* Website:
|
||||
*********************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace HT.Cloud.Domain
|
||||
{
|
||||
public interface IModificationAudited
|
||||
{
|
||||
string F_Id { get; set; }
|
||||
string F_LastModifyUserId { get; set; }
|
||||
DateTime? F_LastModifyTime { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user