Skip to content

Commit

Permalink
Merge pull request #110 from depromeet/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ImNM authored Jul 8, 2022
2 parents 04261dd + a38a091 commit db50a15
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/apis/alarm/alarm.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ export class AlarmService {
user: receiver.userId.toString(),
alarmType: ALARM_STORE_TYPE.LIGHTNING,
};

const sendPushAlarmObj: SendPushAlarmPubDto = {
nickname: sender.nickname,
pushAlarmType: PUSH_ALARM_TYPE.LIGHTNING,
receivers: [receiver.userId],
};
await this.saveAlarmQueue.add(ALARM_STORE_TYPE.LIGHTNING, saveAlarmDto);
await this.pushAlarmQueue.add(PUSH_ALARM_TYPE.LIGHTNING, sendPushAlarmObj);
}
// 내 레벨이 올랐을 때 (기획 기달려야함)

Expand Down
7 changes: 7 additions & 0 deletions src/apis/alarm/dto/sendPushAlarm.sub.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export class SendPushAlarmSubDto {
);
case PUSH_ALARM_TYPE.LIGHTNING_LEVELUP:
return DEEPLINK_BASEURL + 'screen-type?mypage';
case PUSH_ALARM_TYPE.LIGHTNING:
// 변경 요망 딥링크 관련
return DEEPLINK_BASEURL + 'screen-type?mypage';
}
}

Expand All @@ -67,6 +70,8 @@ export class SendPushAlarmSubDto {
return '쪽지가 도착했어요';
case PUSH_ALARM_TYPE.LIGHTNING_LEVELUP:
return '등급이 업그레이드 되었어요!';
case PUSH_ALARM_TYPE.LIGHTNING:
return '파지지직..⚡️';
}
}

Expand All @@ -75,6 +80,8 @@ export class SendPushAlarmSubDto {
switch (this.pushAlarmType) {
case PUSH_ALARM_TYPE.LIGHTNING_LEVELUP:
return '티키타카에서 새로 받은 아이템을 확인해보세요';
case PUSH_ALARM_TYPE.LIGHTNING:
return this.nickname + '님이 번개를 줬어요';
default:
return this.nickname + ' : ' + this.content;
}
Expand Down
7 changes: 7 additions & 0 deletions src/apis/alarm/pushAlarm.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,11 @@ export class PushAlarmProcessor {
const sendPushAlarmDto = plainToInstance(SendPushAlarmSubDto, job.data);
await this.sendPushAlarm(sendPushAlarmDto);
}

@Process(PUSH_ALARM_TYPE.LIGHTNING)
async handleLightningAlarm(job: Job) {
// job.data
const sendPushAlarmDto = plainToInstance(SendPushAlarmSubDto, job.data);
await this.sendPushAlarm(sendPushAlarmDto);
}
}
1 change: 1 addition & 0 deletions src/common/consts/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ enum PUSH_ALARM_TYPE {
LETTER = 'letter',
CHAT = 'chat',
LIGHTNING_LEVELUP = 'lightningLevelUp',
LIGHTNING = 'lightning',
}

// enum ALARM_TYPE {
Expand Down

0 comments on commit db50a15

Please sign in to comment.