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 @@
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
/// <summary>
/// 翻牌任务状态输出
/// </summary>
public class CardFlipStatusOutput
{
/// <summary>
/// 本周总翻牌次数
/// </summary>
public int TotalFlips { get; set; }
/// <summary>
/// 剩余免费次数
/// </summary>
public int RemainingFreeFlips { get; set; }
/// <summary>
/// 剩余赠送次数
/// </summary>
public int RemainingBonusFlips { get; set; }
/// <summary>
/// 剩余邀请解锁次数
/// </summary>
public int RemainingInviteFlips { get; set; }
/// <summary>
/// 是否可以翻牌
/// </summary>
public bool CanFlip { get; set; }
/// <summary>
/// 用户的邀请码
/// </summary>
public string? MyInviteCode { get; set; }
/// <summary>
/// 本周邀请人数
/// </summary>
public int InvitedCount { get; set; }
/// <summary>
/// 是否已被邀请(被邀请后不可再提供邀请码)
/// </summary>
public bool IsInvited { get; set; }
/// <summary>
/// 翻牌记录
/// </summary>
public List<CardFlipRecord> FlipRecords { get; set; } = new();
/// <summary>
/// 下次可翻牌提示
/// </summary>
public string? NextFlipTip { get; set; }
}
/// <summary>
/// 翻牌记录
/// </summary>
public class CardFlipRecord
{
/// <summary>
/// 翻牌序号1-10
/// </summary>
public int FlipNumber { get; set; }
/// <summary>
/// 是否已翻
/// </summary>
public bool IsFlipped { get; set; }
/// <summary>
/// 是否中奖
/// </summary>
public bool IsWin { get; set; }
/// <summary>
/// 奖励金额token数
/// </summary>
public long? RewardAmount { get; set; }
/// <summary>
/// 翻牌类型描述
/// </summary>
public string? FlipTypeDesc { get; set; }
}

View File

@@ -0,0 +1,12 @@
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
/// <summary>
/// 翻牌输入
/// </summary>
public class FlipCardInput
{
/// <summary>
/// 翻牌序号1-10
/// </summary>
public int FlipNumber { get; set; }
}

View File

@@ -0,0 +1,37 @@
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
/// <summary>
/// 翻牌输出
/// </summary>
public class FlipCardOutput
{
/// <summary>
/// 翻牌序号1-10
/// </summary>
public int FlipNumber { get; set; }
/// <summary>
/// 是否中奖
/// </summary>
public bool IsWin { get; set; }
/// <summary>
/// 奖励金额token数
/// </summary>
public long? RewardAmount { get; set; }
/// <summary>
/// 奖励描述
/// </summary>
public string? RewardDesc { get; set; }
/// <summary>
/// 是否显示翻倍包提示第9次中奖后显示
/// </summary>
public bool ShowDoubleRewardTip { get; set; }
/// <summary>
/// 剩余可翻次数
/// </summary>
public int RemainingFlips { get; set; }
}

View File

@@ -0,0 +1,48 @@
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
/// <summary>
/// 邀请码信息输出
/// </summary>
public class InviteCodeOutput
{
/// <summary>
/// 我的邀请码
/// </summary>
public string? MyInviteCode { get; set; }
/// <summary>
/// 本周邀请人数
/// </summary>
public int InvitedCount { get; set; }
/// <summary>
/// 是否已被邀请
/// </summary>
public bool IsInvited { get; set; }
/// <summary>
/// 邀请历史记录
/// </summary>
public List<InvitationHistoryItem> InvitationHistory { get; set; } = new();
}
/// <summary>
/// 邀请历史记录项
/// </summary>
public class InvitationHistoryItem
{
/// <summary>
/// 被邀请人昵称(脱敏)
/// </summary>
public string InvitedUserName { get; set; } = string.Empty;
/// <summary>
/// 邀请时间
/// </summary>
public DateTime InvitationTime { get; set; }
/// <summary>
/// 本周所在
/// </summary>
public string WeekDescription { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,12 @@
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
/// <summary>
/// 使用邀请码输入
/// </summary>
public class UseInviteCodeInput
{
/// <summary>
/// 邀请码
/// </summary>
public string InviteCode { get; set; } = string.Empty;
}

View File

@@ -0,0 +1,41 @@
using Yi.Framework.AiHub.Application.Contracts.Dtos.CardFlip;
namespace Yi.Framework.AiHub.Application.Contracts.IServices;
/// <summary>
/// 翻牌服务接口
/// </summary>
public interface ICardFlipService
{
/// <summary>
/// 获取本周翻牌任务状态
/// </summary>
/// <returns></returns>
Task<CardFlipStatusOutput> GetWeeklyTaskStatusAsync();
/// <summary>
/// 翻牌
/// </summary>
/// <param name="input">翻牌输入</param>
/// <returns></returns>
Task<FlipCardOutput> FlipCardAsync(FlipCardInput input);
/// <summary>
/// 使用邀请码解锁翻牌次数
/// </summary>
/// <param name="input">邀请码输入</param>
/// <returns></returns>
Task UseInviteCodeAsync(UseInviteCodeInput input);
/// <summary>
/// 获取我的邀请码信息
/// </summary>
/// <returns></returns>
Task<InviteCodeOutput> GetMyInviteCodeAsync();
/// <summary>
/// 生成我的邀请码(如果没有)
/// </summary>
/// <returns></returns>
Task<string> GenerateMyInviteCodeAsync();
}