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

48 lines
1.2 KiB

using Easy.DDD.Domain.Auditing;
namespace Easy.AuthorityManagement.Clean.Domain.Entities;
/// <summary>
/// 表示用户对 OU 的成员资格。
/// </summary>
public class OrganizationUnitRole : Entity<Guid>, IHasCreationTime
{
/// <summary>
/// 租户 ID.
/// </summary>
public Guid? TenantId { get; protected set; }
/// <summary>
/// 角色 ID.
/// </summary>
public Guid RoleId { get; protected set; }
/// <summary>
/// 组织Id
/// </summary>
public Guid OrganizationUnitId { get; protected set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreationTime { get; set; }
public OrganizationUnitRole()
{
}
/// <summary>
/// 初始化一个新的实例 <see cref="OrganizationUnitRole"/> 类.
/// </summary>
/// <param name="tenantId">租户Id</param>
/// <param name="roleId">用户 ID.</param>
/// <param name="organizationUnitId">组织Id.</param>
public OrganizationUnitRole(Guid roleId, Guid organizationUnitId, Guid? tenantId = null)
{
RoleId = roleId;
OrganizationUnitId = organizationUnitId;
TenantId = tenantId;
CreationTime = DateTime.Now;
}
}