feat: 添加通关时间记录功能
客户端上报通关时间(秒),存储到 wx_user_level_progress 表 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -146,6 +146,7 @@ export class AuthService {
|
|||||||
const progress = this.userLevelProgressRepository.create({
|
const progress = this.userLevelProgressRepository.create({
|
||||||
userId,
|
userId,
|
||||||
levelId: dto.levelId,
|
levelId: dto.levelId,
|
||||||
|
timeSpent: dto.timeSpent,
|
||||||
});
|
});
|
||||||
await this.userLevelProgressRepository.save(progress);
|
await this.userLevelProgressRepository.save(progress);
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,10 @@ export class EarnPointRequestDto {
|
|||||||
@IsString()
|
@IsString()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
levelId!: string;
|
levelId!: string;
|
||||||
|
|
||||||
|
@ApiProperty({ description: '通关时间(秒)' })
|
||||||
|
@IsNotEmpty()
|
||||||
|
timeSpent!: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GameDataResponseDto {
|
export class GameDataResponseDto {
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ export class UserLevelProgress {
|
|||||||
@JoinColumn({ name: 'user_id' })
|
@JoinColumn({ name: 'user_id' })
|
||||||
user!: User;
|
user!: User;
|
||||||
|
|
||||||
|
@Column({ type: 'int', name: 'time_spent', default: 0 })
|
||||||
|
timeSpent!: number;
|
||||||
|
|
||||||
@CreateDateColumn({ name: 'completed_at' })
|
@CreateDateColumn({ name: 'completed_at' })
|
||||||
completedAt!: Date;
|
completedAt!: Date;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user