ThTenantAdminCredentialEntity.cs
1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using SqlSugar;
using Volo.Abp.Domain.Entities;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace FoodLabeling.Th.Domain.Entities;
/// <summary>
/// 平台主库:租户默认管理员可回显凭据(AES 密文,非登录哈希)
/// </summary>
/// <remarks>
/// 主键列名为 TenantId;仓储泛型键仍用 Guid(映射到 Id)。
/// 勿再对 Id 使用 IsIgnore 别名,否则 SqlSugar Insertable 会 NRE。
/// </remarks>
[SugarTable("fl_th_tenant_admin_credential")]
[DefaultTenantTable]
public class ThTenantAdminCredentialEntity : Entity<Guid>
{
/// <summary>
/// 租户 Id(主键,对应 YiTenant.Id;列名 TenantId)
/// </summary>
[SugarColumn(IsPrimaryKey = true, ColumnName = "TenantId")]
public override Guid Id { get; protected set; }
/// <summary>
/// 管理员登录账号(UserName)
/// </summary>
[SugarColumn(Length = 64)]
public string LoginAccount { get; set; } = string.Empty;
/// <summary>
/// AES-CBC 加密后的可回显密码(Base64 密文)
/// </summary>
[SugarColumn(Length = 512)]
public string PasswordCipher { get; set; } = string.Empty;
/// <summary>
/// AES IV(Base64)
/// </summary>
[SugarColumn(Length = 64)]
public string PasswordIv { get; set; } = string.Empty;
/// <summary>
/// 最后修改时间
/// </summary>
public DateTime? LastModificationTime { get; set; }
public void SetTenantId(Guid tenantId) => Id = tenantId;
}