feat: migrate snowflake ids and refresh migrations

This commit is contained in:
2025-12-02 09:04:37 +08:00
parent 462e15abbb
commit 148475fa43
174 changed files with 8020 additions and 34278 deletions

View File

@@ -8,7 +8,7 @@ public sealed class TenantContext
/// <summary>
/// 未解析到租户时的默认上下文。
/// </summary>
public static TenantContext Empty { get; } = new(Guid.Empty, null, "unresolved");
public static TenantContext Empty { get; } = new(0, null, "unresolved");
/// <summary>
/// 初始化租户上下文。
@@ -16,7 +16,7 @@ public sealed class TenantContext
/// <param name="tenantId">租户 ID</param>
/// <param name="tenantCode">租户编码(可选)</param>
/// <param name="source">解析来源</param>
public TenantContext(Guid tenantId, string? tenantCode, string source)
public TenantContext(long tenantId, string? tenantCode, string source)
{
TenantId = tenantId;
TenantCode = tenantCode;
@@ -26,7 +26,7 @@ public sealed class TenantContext
/// <summary>
/// 当前租户 ID未解析时为 Guid.Empty。
/// </summary>
public Guid TenantId { get; }
public long TenantId { get; }
/// <summary>
/// 当前租户编码(例如子域名或业务编码),可为空。
@@ -41,5 +41,5 @@ public sealed class TenantContext
/// <summary>
/// 是否已成功解析到租户。
/// </summary>
public bool IsResolved => TenantId != Guid.Empty;
public bool IsResolved => TenantId != 0;
}