Files
MemeMind-Server/src/modules/level/dto/complete-level.dto.ts
2026-04-26 17:08:27 +08:00

30 lines
767 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, Min } from 'class-validator';
import { NextLevelDto } from './next-level.dto';
export class CompleteLevelRequestDto {
@ApiProperty({ description: '通关时长(秒)' })
@IsNumber()
@IsNotEmpty()
@Min(0)
timeSpent!: number;
}
export class CompleteLevelResponseDto {
@ApiProperty({ description: '是否为首次通关' })
firstClear!: boolean;
@ApiProperty({ description: '关卡 ID' })
levelId!: string;
@ApiProperty({ description: '通关时长(秒)' })
timeSpent!: number;
@ApiProperty({
description: '下一个待通关的关卡(全部通关时为 null',
nullable: true,
type: NextLevelDto,
})
nextLevel!: NextLevelDto | null;
}