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:
richarjiang
2026-04-08 11:46:54 +08:00
parent 2dd22b10b1
commit 3d52cfe843
12 changed files with 960 additions and 2 deletions

View File

@@ -27,4 +27,19 @@ export class ShareParticipantRepository {
async countByShareConfigId(shareConfigId: string): Promise<number> {
return this.repository.count({ where: { shareConfigId } });
}
async findByShareConfigAndParticipant(
shareConfigId: string,
participantId: string,
): Promise<ShareParticipant | null> {
return this.repository.findOne({ where: { shareConfigId, participantId } });
}
create(data: Partial<ShareParticipant>): ShareParticipant {
return this.repository.create(data);
}
async save(participant: ShareParticipant): Promise<ShareParticipant> {
return this.repository.save(participant);
}
}