为睡眠挑战类型添加勋章信息支持,在挑战列表和详情接口中返回 sleepChallengeMonth 勋章配置数据。 - 在 ChallengesModule 中注册 BadgeConfig 模型 - 在 ChallengesService 中注入 BadgeConfig 仓库 - 查询列表时,若存在睡眠挑战则预加载勋章配置 - 查询详情时,若为睡眠挑战则附加勋章信息 - 在 DTO 中新增 BadgeInfoDto 接口定义勋章数据结构 - 仅对激活状态的 sleepChallengeMonth 勋章进行查询和展示
33 lines
795 B
TypeScript
33 lines
795 B
TypeScript
import { ChallengeProgressDto, RankingItemDto } from './challenge-progress.dto';
|
|
import { ChallengeType } from '../models/challenge.model';
|
|
|
|
export interface BadgeInfoDto {
|
|
code: string;
|
|
name: string;
|
|
description: string;
|
|
imageUrl: string;
|
|
category: string;
|
|
}
|
|
|
|
export interface ChallengeDetailDto {
|
|
id: string;
|
|
title: string;
|
|
image: string | null;
|
|
periodLabel: string | null;
|
|
durationLabel: string;
|
|
requirementLabel: string;
|
|
summary: string | null;
|
|
rankingDescription: string | null;
|
|
highlightTitle: string;
|
|
highlightSubtitle: string;
|
|
ctaLabel: string;
|
|
minimumCheckInDays: number;
|
|
participantsCount: number;
|
|
progress?: ChallengeProgressDto;
|
|
rankings: RankingItemDto[];
|
|
userRank?: number;
|
|
type: ChallengeType;
|
|
unit: string;
|
|
badge?: BadgeInfoDto;
|
|
}
|