feat(challenges): 支持自定义挑战类型并优化必填字段验证
- 新增 CUSTOM 挑战类型枚举值 - requirementLabel 字段改为可选,允许为空并添加默认值处理 - minimumCheckInDays 最大值从 365 提升至 1000,支持更长周期挑战 - 推送通知模板支持自定义挑战的动态文案生成 - 新增 getCustomEncouragementTemplate 和 getCustomInvitationTemplate 函数
This commit is contained in:
@@ -216,7 +216,7 @@ export class ChallengeReminderService {
|
||||
}
|
||||
|
||||
// 获取鼓励文案
|
||||
const template = getEncouragementTemplate(participant.challenge.type);
|
||||
const template = getEncouragementTemplate(participant.challenge.type, participant.challenge.title);
|
||||
|
||||
// 发送推送
|
||||
const result = await this.pushNotificationsService.sendBatchNotificationToDevices({
|
||||
@@ -281,7 +281,7 @@ export class ChallengeReminderService {
|
||||
// 获取邀请文案
|
||||
const template = reminderType === ReminderType.GENERAL_INVITATION
|
||||
? getGeneralInvitationTemplate()
|
||||
: getInvitationTemplate(randomChallenge.type);
|
||||
: getInvitationTemplate(randomChallenge.type, randomChallenge.title);
|
||||
|
||||
// 发送推送
|
||||
const result = await this.pushNotificationsService.sendBatchNotificationToDevices({
|
||||
|
||||
Reference in New Issue
Block a user