You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ys.Core.Common;
using FreeSql.DataAnnotations;
namespace djy.Paas.Model
{/// <summary>
/// 基础基类
/// </summary>
public class DataBase
{
/// <summary>
///用户查询条件的Idlist
/// </summary>
[Column(IsIgnore =true)]
public List<Guid?> Gidlist { get; set; } = new List<Guid?>();
/// <summary>
/// 主键ID
/// </summary>
[Column(IsIdentity = true, IsPrimary = true,Position =1)]
public long Id { get; set; } = 0;
/// <summary>
/// Guid主键
/// </summary>
public Guid? Gid { get; set; } = null;
/// <summary>
/// 数据状态 -1删除 0为不可用 1正常 1-99为各种状态 100为完成
/// </summary>
[Column(Position =-1)]
public virtual short Status { get; set; }
/// <summary>
/// 创建时间戳秒级
/// </summary>
[Column(Position =-2)]
public long AddTime { get; set; } = 0;
/// <summary>
/// 更新时间戳
/// </summary>
[Column(Position =-3)]
public long UpTime
{
get; set;
} = DateTime.Now.ToTimeStampSeconds();
/// <summary>
/// 初始化默认属性 Id,Guid,CreateTime,CreateTimeStamp,Status
/// </summary>
public void Init()
{
Id = 0;
Gid =Gid==null? Guid.NewGuid():Gid;
DateTime Createnow = DateTime.Now;
AddTime = AddTime>0?AddTime: Createnow.ToTimeStampSeconds();
Status =Status!=0?Status:(short)EnumUser.Status.On;
}
}
}