30 lines
767 B
TypeScript
30 lines
767 B
TypeScript
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;
|
||
}
|