feat(share): 分享挑战关卡进度记录功能
- 新增 Level.timeLimit 字段支持关卡时间限制 - 新增 ShareLevelProgress 实体记录单关通关进度 - 新增 ShareLevelProgressRepository - 新增 DTO: ReportLevelProgressDto, ReportLevelProgressResponseDto - 新增 POST /v1/share/progress 接口用于上报进度 - 支持仅首次通关有效判断 - 支持时间限制内通关判断 - 不可变模式更新进度记录 - 数据库迁移脚本 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
23
src/modules/share/dto/report-level-progress.dto.ts
Normal file
23
src/modules/share/dto/report-level-progress.dto.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsNotEmpty, IsNumber, IsString, Min } from 'class-validator';
|
||||
|
||||
export class ReportLevelProgressDto {
|
||||
@ApiProperty({ description: '分享码' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
shareCode!: string;
|
||||
|
||||
@ApiProperty({ description: '关卡 ID' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
levelId!: string;
|
||||
|
||||
@ApiProperty({ description: '是否通过' })
|
||||
@IsBoolean()
|
||||
passed!: boolean;
|
||||
|
||||
@ApiProperty({ description: '通关时间(秒)' })
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
timeSpent!: number;
|
||||
}
|
||||
Reference in New Issue
Block a user