2025-10-23 21:58:47 +08:00
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
using Volo.Abp.Domain.Entities.Auditing;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.AiHub.Domain.Entities;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用户邀请码
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarTable("Ai_InviteCode")]
|
|
|
|
|
|
[SugarIndex($"index_{nameof(UserId)}", nameof(UserId), OrderByType.Asc, true)]
|
|
|
|
|
|
[SugarIndex($"index_{nameof(Code)}", nameof(Code), OrderByType.Asc, true)]
|
|
|
|
|
|
public class InviteCodeAggregateRoot : FullAuditedAggregateRoot<Guid>
|
|
|
|
|
|
{
|
|
|
|
|
|
public InviteCodeAggregateRoot()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public InviteCodeAggregateRoot(Guid userId, string code)
|
|
|
|
|
|
{
|
|
|
|
|
|
UserId = userId;
|
|
|
|
|
|
Code = code;
|
|
|
|
|
|
UsedCount = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用户ID(邀请码拥有者)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public Guid UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 邀请码(唯一)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarColumn(Length = 50)]
|
|
|
|
|
|
public string Code { get; set; } = string.Empty;
|
2025-11-14 23:53:29 +08:00
|
|
|
|
|
2025-10-23 21:58:47 +08:00
|
|
|
|
/// <summary>
|
2025-11-07 21:31:18 +08:00
|
|
|
|
/// 被使用次数(统计用,一个邀请码可以被多人使用)
|
2025-10-23 21:58:47 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public int UsedCount { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 备注信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[SugarColumn(Length = 500, IsNullable = true)]
|
|
|
|
|
|
public string? Remark { get; set; }
|
2025-11-14 23:53:29 +08:00
|
|
|
|
|
2025-10-23 21:58:47 +08:00
|
|
|
|
}
|