From 0bf2613167caf60e2fd366bebdae09519ce0eaf2 Mon Sep 17 00:00:00 2001 From: Eunjin3395 Date: Fri, 20 Sep 2024 00:25:05 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20[Feat]=20=EB=A7=A4=EB=84=88?= =?UTF-8?q?=ED=8F=89=EA=B0=80=20=EC=88=98=EC=A0=95=20=EB=A9=94=EC=86=8C?= =?UTF-8?q?=EB=93=9C=EC=97=90=20=EC=95=8C=EB=A6=BC=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gamegoo/service/manner/MannerService.java | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gamegoo/service/manner/MannerService.java b/src/main/java/com/gamegoo/service/manner/MannerService.java index ddc5d773..3390e347 100644 --- a/src/main/java/com/gamegoo/service/manner/MannerService.java +++ b/src/main/java/com/gamegoo/service/manner/MannerService.java @@ -307,7 +307,20 @@ public MannerRating update(MannerRequest.mannerUpdateDTO request, Long memberId, int mannerScore = updateMannerScore(targetMember); // 매너레벨 결정. - int mannerLevel = mannerLevel(mannerScore); + Integer mannerLevel = mannerLevel(mannerScore); + + // 매너레벨 상승 알림 전송 + if (targetMember.getMannerLevel() < mannerLevel) { + Notification mannerUpNotification = notificationService.createNotification( + NotificationTypeTitle.MANNER_LEVEL_UP, mannerLevel.toString(), + null, targetMember); + notificationRepository.save(mannerUpNotification); + } else if (targetMember.getMannerLevel() > mannerLevel) { // 매너레벨 하락 알림 전송 + Notification mannerDownNotification = notificationService.createNotification( + NotificationTypeTitle.MANNER_LEVEL_DOWN, mannerLevel.toString(), + null, targetMember); + notificationRepository.save(mannerDownNotification); + } // 매너레벨 반영. targetMember.setMannerLevel(mannerLevel); @@ -374,7 +387,20 @@ public MannerRating update(MannerRequest.mannerUpdateDTO request, Long memberId, int mannerScore = updateMannerScore(targetMember); // 매너레벨 결정. - int mannerLevel = mannerLevel(mannerScore); + Integer mannerLevel = mannerLevel(mannerScore); + + // 매너레벨 상승 알림 전송 + if (targetMember.getMannerLevel() < mannerLevel) { + Notification mannerUpNotification = notificationService.createNotification( + NotificationTypeTitle.MANNER_LEVEL_UP, mannerLevel.toString(), + null, targetMember); + notificationRepository.save(mannerUpNotification); + } else if (targetMember.getMannerLevel() > mannerLevel) { // 매너레벨 하락 알림 전송 + Notification mannerDownNotification = notificationService.createNotification( + NotificationTypeTitle.MANNER_LEVEL_DOWN, mannerLevel.toString(), + null, targetMember); + notificationRepository.save(mannerDownNotification); + } // 매너레벨 반영. targetMember.setMannerLevel(mannerLevel);