Skip to content

Commit

Permalink
Merge pull request #226 from Gamegoo-repo/feat/225
Browse files Browse the repository at this point in the history
[Feat/225] ๋งค๋„ˆ ๋ ˆ๋ฒจ ์ƒ์Šน/ํ•˜๋ฝ ์‹œ ์•Œ๋ฆผ ๋“ฑ๋ก ๊ธฐ๋Šฅ ์ถ”๊ฐ€
  • Loading branch information
Eunjin3395 authored Sep 19, 2024
2 parents 6965b79 + 0bf2613 commit fbd72c5
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/main/java/com/gamegoo/service/manner/MannerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit fbd72c5

Please sign in to comment.