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);