feat: 新增翻牌活动入口与全局组件声明

- 在 Header Avatar 菜单新增翻牌活动(cardFlip)入口,并添加对应插槽 <card-flip-activity/>
- 在 types/components.d.ts 中添加 CardFlipActivity 与 ElCollapseTransition 类型声明
- 在 .eslintrc-auto-import.json 中新增 ElMessage 与 ElMessageBox 自动导入
- 从 import_meta.d.ts 中移除 VITE_BUILD_COMPRESS 环境声明
- 在 YiAbpWebModule.cs 中添加相关 using 并保留数据库建表初始化的注释(CodeFirst.InitTables)
This commit is contained in:
chenchun
2025-10-23 21:58:47 +08:00
parent 1aaff2942d
commit aec90ec9d6
18 changed files with 2275 additions and 2 deletions

View File

@@ -0,0 +1,88 @@
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;
IsUsed = false;
IsUserInvited = false;
UsedCount = 0;
}
/// <summary>
/// 用户ID邀请码拥有者
/// </summary>
public Guid UserId { get; set; }
/// <summary>
/// 邀请码(唯一)
/// </summary>
[SugarColumn(Length = 50)]
public string Code { get; set; } = string.Empty;
/// <summary>
/// 是否已被使用(一个邀请码只能被使用一次)
/// </summary>
public bool IsUsed { get; set; }
/// <summary>
/// 邀请码拥有者是否已被他人邀请(被邀请后不可再提供邀请码)
/// </summary>
public bool IsUserInvited { get; set; }
/// <summary>
/// 被使用次数(统计用)
/// </summary>
public int UsedCount { get; set; }
/// <summary>
/// 使用时间
/// </summary>
public DateTime? UsedTime { get; set; }
/// <summary>
/// 使用人ID
/// </summary>
public Guid? UsedByUserId { get; set; }
/// <summary>
/// 备注信息
/// </summary>
[SugarColumn(Length = 500, IsNullable = true)]
public string? Remark { get; set; }
/// <summary>
/// 标记邀请码已被使用
/// </summary>
/// <param name="usedByUserId">使用者ID</param>
public void MarkAsUsed(Guid usedByUserId)
{
IsUsed = true;
UsedTime = DateTime.Now;
UsedByUserId = usedByUserId;
UsedCount++;
}
/// <summary>
/// 标记用户已被邀请
/// </summary>
public void MarkUserAsInvited()
{
IsUserInvited = true;
}
}