feat: 对接最新的关卡工作流
This commit is contained in:
@@ -20,6 +20,34 @@ export interface StaminaInfo {
|
||||
nextRecoverAt: string | null;
|
||||
}
|
||||
|
||||
/** 下一关完整数据(多个接口共用) */
|
||||
export interface NextLevelData {
|
||||
/** 关卡 ID */
|
||||
id: string;
|
||||
/** 关卡编号(sortOrder) */
|
||||
level: number;
|
||||
/** 图片1 URL */
|
||||
image1Url: string;
|
||||
/** 图片1 文本说明 */
|
||||
image1Description: string | null;
|
||||
/** 图片2 URL */
|
||||
image2Url: string;
|
||||
/** 图片2 文本说明 */
|
||||
image2Description: string | null;
|
||||
/** 答案 */
|
||||
answer: string;
|
||||
/** 谐音梗说明 */
|
||||
punchline: string | null;
|
||||
/** 线索1 */
|
||||
hint1: string | null;
|
||||
/** 线索2 */
|
||||
hint2: string | null;
|
||||
/** 线索3 */
|
||||
hint3: string | null;
|
||||
/** 限时(秒),null 表示不限时 */
|
||||
timeLimit: number | null;
|
||||
}
|
||||
|
||||
/** 登录响应数据 */
|
||||
export interface WxLoginData {
|
||||
token: string;
|
||||
@@ -43,31 +71,10 @@ export interface GameData {
|
||||
id: string;
|
||||
stamina: StaminaInfo;
|
||||
};
|
||||
completedLevelIds: string[];
|
||||
completedLevelCount?: number;
|
||||
}
|
||||
|
||||
/** 关卡列表项 */
|
||||
export interface LevelListItem {
|
||||
id: string;
|
||||
level: number;
|
||||
image1Url: string;
|
||||
image1Description: string | null;
|
||||
image2Url: string;
|
||||
image2Description: string | null;
|
||||
answer: string | null;
|
||||
punchline: string | null;
|
||||
hint1: string | null;
|
||||
hint2: string | null;
|
||||
hint3: string | null;
|
||||
completed: boolean;
|
||||
timeSpent: number | null;
|
||||
}
|
||||
|
||||
/** 关卡列表响应 */
|
||||
export interface LevelListData {
|
||||
levels: LevelListItem[];
|
||||
total: number;
|
||||
/** 已通关的关卡数量 */
|
||||
completedLevelCount: number;
|
||||
/** 下一个待通关的关卡(全部通关时为 null) */
|
||||
nextLevel: NextLevelData | null;
|
||||
}
|
||||
|
||||
/** 进入关卡响应 */
|
||||
@@ -84,6 +91,8 @@ export interface EnterLevelData {
|
||||
hint2: string | null;
|
||||
hint3: string | null;
|
||||
stamina: StaminaInfo;
|
||||
/** 预加载的下一关数据(无下一关时为 null) */
|
||||
preloadNextLevel: NextLevelData | null;
|
||||
}
|
||||
|
||||
/** 通关上报响应 */
|
||||
@@ -91,6 +100,8 @@ export interface CompleteLevelData {
|
||||
firstClear: boolean;
|
||||
levelId: string;
|
||||
timeSpent: number;
|
||||
/** 下一个待通关的关卡(全部通关时为 null) */
|
||||
nextLevel: NextLevelData | null;
|
||||
}
|
||||
|
||||
/** 创建分享响应 */
|
||||
|
||||
@@ -1,52 +1,5 @@
|
||||
import { SpriteFrame } from 'cc';
|
||||
|
||||
/**
|
||||
* API 返回的单个关卡数据结构(关卡列表)
|
||||
*/
|
||||
export interface ApiLevelData {
|
||||
/** 关卡 ID (UUID) */
|
||||
id: string;
|
||||
/** 关卡序号 */
|
||||
level: number;
|
||||
/** 图片1 URL */
|
||||
image1Url: string;
|
||||
/** 图片1 文本说明 */
|
||||
image1Description: string | null;
|
||||
/** 图片2 URL */
|
||||
image2Url: string;
|
||||
/** 图片2 文本说明 */
|
||||
image2Description: string | null;
|
||||
/** 谐音梗说明(仅通关后返回,未通关为 null) */
|
||||
punchline: string | null;
|
||||
/** 线索1(未通关时为 null) */
|
||||
hint1: string | null;
|
||||
/** 线索2(未通关时为 null) */
|
||||
hint2: string | null;
|
||||
/** 线索3(未通关时为 null) */
|
||||
hint3: string | null;
|
||||
/** 答案(未通关时为 null) */
|
||||
answer: string | null;
|
||||
/** 是否已通关 */
|
||||
completed: boolean;
|
||||
/** 通关时长(秒),未通关时为 null */
|
||||
timeSpent: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* API 响应结构(关卡列表)
|
||||
*/
|
||||
export interface ApiResponse {
|
||||
/** 是否成功 */
|
||||
success: boolean;
|
||||
/** 响应消息 */
|
||||
message: string | null;
|
||||
/** 响应数据 */
|
||||
data: {
|
||||
levels: ApiLevelData[];
|
||||
total: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行时关卡配置(包含已加载的图片)
|
||||
*/
|
||||
@@ -65,14 +18,16 @@ export interface RuntimeLevelConfig {
|
||||
image2Description: string | null;
|
||||
/** 谐音梗说明 */
|
||||
punchline: string | null;
|
||||
/** 线索1(未通关时为 null,进入关卡后由 enter 接口获取) */
|
||||
/** 线索1 */
|
||||
clue1: string | null;
|
||||
/** 线索2(未通关时为 null) */
|
||||
/** 线索2 */
|
||||
clue2: string | null;
|
||||
/** 线索3(未通关时为 null) */
|
||||
/** 线索3 */
|
||||
clue3: string | null;
|
||||
/** 答案(未通关时为 null,进入关卡后由 enter 接口获取) */
|
||||
/** 答案 */
|
||||
answer: string | null;
|
||||
/** 是否已通关 */
|
||||
completed: boolean;
|
||||
/** 限时(秒),null 表示不限时 */
|
||||
timeLimit: number | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user