Skip to content

Commit

Permalink
refactor: 사용자 정지 시, 정지 대상에게 알림 전송
Browse files Browse the repository at this point in the history
  • Loading branch information
hgh1472 committed Dec 8, 2024
1 parent 2d0f74e commit fa81ba0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/postman/bottler/user/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import postman.bottler.notification.domain.NotificationType;
import postman.bottler.notification.service.NotificationService;
import postman.bottler.slack.SlackConstant;
import postman.bottler.slack.SlackService;
import postman.bottler.user.auth.JwtTokenProvider;
Expand Down Expand Up @@ -45,6 +47,7 @@ public class UserService {
private final AuthenticationManagerBuilder authenticationManagerBuilder;
private final EmailService emailService;
private final SlackService slackService;
private final NotificationService notificationService;

private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private static final int CODE_LENGTH = 8;
Expand Down Expand Up @@ -242,6 +245,7 @@ public void updateWarningCount(Long userId) {
if (user.checkBan()) {
banService.banUser(user);
slackService.sendSlackMessage(SlackConstant.BAN, userId);
notificationService.sendNotification(NotificationType.BAN, userId, null, null);
}
userRepository.updateWarningCount(user);
}
Expand Down

0 comments on commit fa81ba0

Please sign in to comment.