diff --git a/src/apis/alarm/alarm.service.ts b/src/apis/alarm/alarm.service.ts index c6b817d..c39ec5c 100644 --- a/src/apis/alarm/alarm.service.ts +++ b/src/apis/alarm/alarm.service.ts @@ -146,15 +146,18 @@ export class AlarmService { user: receiver.userId.toString(), content: comment, roomName: room.name, + roomId: room._id.toString(), alarmType: ALARM_STORE_TYPE.COMMENT, questionId: questionIdDto.questionId.toString(), }; + // console.log(saveAlarmDto); await this.saveAlarmQueue.add(ALARM_STORE_TYPE.COMMENT, saveAlarmDto); const sendPushAlarmObj: SendPushAlarmPubDto = { nickname: sender.nickname, content: comment, receivers: [receiver.userId], + roomId: room._id.toString(), pushAlarmType: PUSH_ALARM_TYPE.COMMENT, questionId: questionIdDto.questionId.toString(), }; diff --git a/src/apis/alarm/dto/alarmShow.dto.ts b/src/apis/alarm/dto/alarmShow.dto.ts index 373d08e..ce95e68 100644 --- a/src/apis/alarm/dto/alarmShow.dto.ts +++ b/src/apis/alarm/dto/alarmShow.dto.ts @@ -20,6 +20,10 @@ export class AlarmShowDto { @Expose({ toClassOnly: true }) roomName?: string; + @Exclude({ toPlainOnly: true }) + @Expose({ toClassOnly: true }) + roomId?: string; + @Exclude({ toPlainOnly: true }) @Expose({ toClassOnly: true }) nickname: string; @@ -44,9 +48,13 @@ export class AlarmShowDto { case ALARM_STORE_TYPE.LIGHTNING: return DEEPLINK_BASEURL + 'screen-type?mypage'; case ALARM_STORE_TYPE.COMMENT: - return ( - DEEPLINK_BASEURL + 'question-detail?question_id=' + this.questionId - ); + const link = + DEEPLINK_BASEURL + 'question-detail?question_id=' + this.questionId; + if (this.roomId) { + return link + '&chat-room_id=' + this.roomId; + } else { + return link; + } default: return ''; } diff --git a/src/apis/alarm/dto/saveAlarm.dto.ts b/src/apis/alarm/dto/saveAlarm.dto.ts index 6888dd5..69c1c52 100644 --- a/src/apis/alarm/dto/saveAlarm.dto.ts +++ b/src/apis/alarm/dto/saveAlarm.dto.ts @@ -20,6 +20,9 @@ export class SaveAlarmDto { @Expose() questionId?: string; + @Expose() + roomId?: string; + //need to be updated 딥링크 양식 정의 필요 ( 클라와 함께) // @Expose() // get deepLink(): string { diff --git a/src/apis/alarm/dto/sendPushAlarm.sub.dto.ts b/src/apis/alarm/dto/sendPushAlarm.sub.dto.ts index 81c88f5..1a0faea 100644 --- a/src/apis/alarm/dto/sendPushAlarm.sub.dto.ts +++ b/src/apis/alarm/dto/sendPushAlarm.sub.dto.ts @@ -41,7 +41,11 @@ export class SendPushAlarmSubDto { ); case PUSH_ALARM_TYPE.COMMENT: return ( - DEEPLINK_BASEURL + 'question-detail?question_id=' + this.questionId + DEEPLINK_BASEURL + + 'question-detail?question_id=' + + this.questionId + + '&chat-room_id=' + + this.roomId ); case PUSH_ALARM_TYPE.LETTER: return ( diff --git a/src/apis/alarm/pushAlarm.processor.ts b/src/apis/alarm/pushAlarm.processor.ts index 62617e4..87a7d4d 100644 --- a/src/apis/alarm/pushAlarm.processor.ts +++ b/src/apis/alarm/pushAlarm.processor.ts @@ -71,7 +71,6 @@ export class PushAlarmProcessor { @Process(PUSH_ALARM_TYPE.CHAT) async handleChatAlarm(job: Job) { // job.data - // TODO : 서로 차단된 유저는 알림에서 빼야함. console.log('processor ALARM Comment ', job.data); const chatAlarmSubDto = plainToInstance(ChatAlarmSubDto, job.data); diff --git a/src/apis/letter/letter.service.ts b/src/apis/letter/letter.service.ts index 10714bd..91f468d 100644 --- a/src/apis/letter/letter.service.ts +++ b/src/apis/letter/letter.service.ts @@ -60,7 +60,6 @@ export class LetterService { throw new BadRequestException('탈퇴한 유저'); } - //TODO : 400 번대 // 보낼 수 없는 사용자 추가 const letterRoom = await this.upsertUserListToLetterRoom(twoUserList); diff --git a/src/models/alarm.model.ts b/src/models/alarm.model.ts index aaed82d..45afeeb 100644 --- a/src/models/alarm.model.ts +++ b/src/models/alarm.model.ts @@ -56,6 +56,11 @@ export class Alarm { }) roomName: string; + @Prop({ + type: String, + }) + roomId: string; + @Prop({ default: '', type: String,