From d87b5837f5a6ee8044ae1e5264b35b5cc9c3f1df Mon Sep 17 00:00:00 2001 From: kaaang Date: Sun, 18 Feb 2024 19:44:50 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=95=8C=EB=A6=BC=EC=97=90=20=EC=9B=90?= =?UTF-8?q?=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20=EC=A0=9C=EB=AA=A9=EC=9D=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=ED=95=98=EB=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/comment/comment.service.ts | 1 + src/notification/notification.entity.ts | 3 +++ src/notification/notification.service.ts | 1 + src/signature/signature.comment.service.ts | 2 ++ src/signature/signature.service.ts | 1 + 5 files changed, 8 insertions(+) diff --git a/src/comment/comment.service.ts b/src/comment/comment.service.ts index acb25f2..f3a2ba1 100644 --- a/src/comment/comment.service.ts +++ b/src/comment/comment.service.ts @@ -43,6 +43,7 @@ export class CommentService { notification.notificationSender = user; notification.notificationTargetType = 'RULE'; notification.notificationTargetId = rule.id; + notification.notificationTargetDesc = rule.mainTitle; notification.notificationAction = 'COMMENT'; await notification.save(); } diff --git a/src/notification/notification.entity.ts b/src/notification/notification.entity.ts index 90fa3d7..90322cf 100644 --- a/src/notification/notification.entity.ts +++ b/src/notification/notification.entity.ts @@ -30,6 +30,9 @@ export class NotificationEntity extends BaseEntity { @Column() notificationTargetId: number; + @Column({ type: 'text' }) + notificationTargetDesc: string; + @Column({ type: 'enum', enum: ['LIKE', 'COMMENT'] }) notificationAction: 'LIKE' | 'COMMENT'; diff --git a/src/notification/notification.service.ts b/src/notification/notification.service.ts index 8e97115..dff1d47 100644 --- a/src/notification/notification.service.ts +++ b/src/notification/notification.service.ts @@ -48,6 +48,7 @@ export class NotificationService { action: notification.notificationAction, }, itemId: notification.notificationTargetId, + itemDesc: notification.notificationTargetDesc, isRead: notification.notificationRead, created: notification.created, })), diff --git a/src/signature/signature.comment.service.ts b/src/signature/signature.comment.service.ts index e12b764..67515de 100644 --- a/src/signature/signature.comment.service.ts +++ b/src/signature/signature.comment.service.ts @@ -69,6 +69,7 @@ export class SignatureCommentService { } notification.notificationReceiver = parentComment.user; + notification.notificationTargetDesc = parentComment.content; } else { // 댓글: parentId는 본인으로 설정 const savedComment = await comment.save(); @@ -76,6 +77,7 @@ export class SignatureCommentService { await savedComment.save(); notification.notificationReceiver = signature.user; + notification.notificationTargetDesc = signature.title; } notification.notificationSender = user; diff --git a/src/signature/signature.service.ts b/src/signature/signature.service.ts index a668598..63e3d1c 100644 --- a/src/signature/signature.service.ts +++ b/src/signature/signature.service.ts @@ -275,6 +275,7 @@ export class SignatureService { notification.notificationSender = loginUser; notification.notificationTargetType = 'SIGNATURE'; notification.notificationTargetId = signature.id; + notification.notificationTargetDesc = signature.title; notification.notificationAction = 'LIKE'; await notification.save();