Files
tnb.server/system/Tnb.Systems.Entitys/Entity/Permission/OrganizeRelationEntity.cs
2023-03-13 15:00:34 +08:00

63 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using JNPF.Common.Const;
using JNPF.Common.Contracts;
using SqlSugar;
using Yitter.IdGenerator;
namespace JNPF.Systems.Entitys.Permission;
/// <summary>
/// 用户关系映射.
/// </summary>
[SugarTable("BASE_ORGANIZE_RELATION")]
public class OrganizeRelationEntity : EntityBase<string>
{
/// <summary>
/// 获取或设置 组织Id.
/// </summary>
[SugarColumn(ColumnName = "F_ORGANIZE_ID", ColumnDescription = "组织Id")]
public string OrganizeId { get; set; }
/// <summary>
/// 对象类型角色Role、岗位Position.
/// </summary>
[SugarColumn(ColumnName = "F_OBJECT_TYPE", ColumnDescription = "对象类型角色Role、岗位Position")]
public string ObjectType { get; set; }
/// <summary>
/// 获取或设置 对象主键.
/// </summary>
[SugarColumn(ColumnName = "F_OBJECT_ID", ColumnDescription = "对象主键")]
public string ObjectId { get; set; }
/// <summary>
/// 排序码.
/// </summary>
[SugarColumn(ColumnName = "F_SORT_CODE")]
public long? SortCode { get; set; }
/// <summary>
/// 获取或设置 创建时间.
/// </summary>
[SugarColumn(ColumnName = "F_CREATOR_TIME", ColumnDescription = "创建时间")]
public DateTime? CreatorTime { get; set; }
/// <summary>
/// 获取或设置 创建用户.
/// </summary>
[SugarColumn(ColumnName = "F_CREATOR_USER_ID", ColumnDescription = "创建用户")]
public string CreatorUserId { get; set; }
/// <summary>
/// 创建.
/// </summary>
public virtual void Creator()
{
var userId = App.User.FindFirst(ClaimConst.CLAINMUSERID)?.Value;
CreatorTime = DateTime.Now;
Id = YitIdHelper.NextId().ToString();
if (!string.IsNullOrEmpty(userId))
{
CreatorUserId = userId;
}
}
}