fix(level): 默认返回 punchline 和 hint1 线索提示

未通关用户现在可以查看谐音梗说明和第一个线索提示,
hint2/hint3 仍需通关后才显示。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
richarjiang
2026-04-24 21:37:13 +08:00
parent e6079e4345
commit e5d6c3a674
2 changed files with 5 additions and 4 deletions

View File

@@ -22,10 +22,10 @@ export class LevelListItemDto {
@ApiProperty({ description: '答案(仅已通关时返回)', nullable: true }) @ApiProperty({ description: '答案(仅已通关时返回)', nullable: true })
answer!: string | null; answer!: string | null;
@ApiProperty({ description: '谐音梗说明(仅已通关时返回)', nullable: true }) @ApiProperty({ description: '谐音梗说明(始终返回)', nullable: true })
punchline!: string | null; punchline!: string | null;
@ApiProperty({ description: '线索1仅已通关时返回)', nullable: true }) @ApiProperty({ description: '线索1始终返回)', nullable: true })
hint1!: string | null; hint1!: string | null;
@ApiProperty({ description: '线索2仅已通关时返回', nullable: true }) @ApiProperty({ description: '线索2仅已通关时返回', nullable: true })

View File

@@ -31,6 +31,7 @@ export function pickLevelImageFields(level: Level): LevelImageFields {
/** /**
* Pick image fields with answer/hints masked for non-completed levels. * Pick image fields with answer/hints masked for non-completed levels.
* hint1 is always shown (first clue is the default hint shown to players).
*/ */
export function pickLevelImageFieldsMasked( export function pickLevelImageFieldsMasked(
level: Level, level: Level,
@@ -41,8 +42,8 @@ export function pickLevelImageFieldsMasked(
image1Description: level.image1Description, image1Description: level.image1Description,
image2Url: level.image2Url, image2Url: level.image2Url,
image2Description: level.image2Description, image2Description: level.image2Description,
punchline: completed ? level.punchline : null, punchline: level.punchline,
hint1: completed ? level.hint1 : null, hint1: level.hint1,
hint2: completed ? level.hint2 : null, hint2: completed ? level.hint2 : null,
hint3: completed ? level.hint3 : null, hint3: completed ? level.hint3 : null,
}; };