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

46 lines
1.1 KiB
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 { NextLevelDto } from '../../level/dto/next-level.dto';
export class StaminaInfoDto {
@ApiProperty({ description: '当前体力值' })
current!: number;
@ApiProperty({ description: '体力值上限' })
max!: number;
@ApiProperty({
description: '下次恢复时间ISO 字符串),满体力时为 null',
nullable: true,
})
nextRecoverAt!: string | null;
}
export class UserProfileResponseDto {
@ApiProperty({ description: '用户 ID' })
id!: string;
@ApiProperty({ description: '用户昵称', nullable: true })
nickname!: string | null;
@ApiProperty({ description: '体力信息' })
stamina!: StaminaInfoDto;
}
export class GameDataResponseDto {
@ApiProperty({ description: '用户信息' })
user!: {
id: string;
stamina: StaminaInfoDto;
};
@ApiProperty({ description: '已通关的关卡数量' })
completedLevelCount!: number;
@ApiProperty({
description: '下一个待通关的关卡(全部通关时为 null',
nullable: true,
type: NextLevelDto,
})
nextLevel!: NextLevelDto | null;
}