Skip to content

Commit

Permalink
fix: MemberService 종속성 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertImKr committed Nov 15, 2023
1 parent f76ba20 commit efee2ef
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void changeStatus(String memberId, String notificationId, boolean isRead)

@Transactional(readOnly = true)
public Slice<NotificationResponse> requestAll(String memberId, Pageable pageable) {
// memberService.validateIdExists(memberId);
memberService.findById(memberId);
Slice<Notification> notifications = notificationRepository.findAllByMemberId(memberId, pageable);
return notificationMapper.generateResponseDtoSliceFromNotifications(notifications);
}
Expand All @@ -54,21 +54,21 @@ public void delete(String memberId, String notificationId) {

@Transactional
public void deleteAll(String memberId) {
// memberService.validateIdExists(memberId);
memberService.findById(memberId);
notificationRepository.deleteAllByMemberId(memberId, LocalDateTime.now());
}

@Transactional
public NotificationResponse requestOne(String memberId, String notificationId) {
// memberService.validateIdExists(memberId);
memberService.findById(memberId);
Notification notification = getNotification(notificationId);
notification.changeStatus(true, memberId, LocalDateTime.now());
return notificationMapper.generateResponseDtoFromNotification(notification);
}

@Transactional
public void changeAllStatus(String memberId, List<String> notificationIds, boolean read) {
// memberService.validateIdExists(memberId);
memberService.findById(memberId);
notificationRepository.updateAllStatus(read, memberId, LocalDateTime.now(),
NotificationMapper.toNotificationID(notificationIds));
}
Expand All @@ -79,7 +79,7 @@ public Notification getNotification(String notificationId) {

@Transactional
public void deleteAll(String memberId, List<String> notificationIds) {
// memberService.validateIdExists(memberId);
memberService.findById(memberId);
notificationRepository.deleteAllByIdIn(
NotificationMapper.toNotificationID(notificationIds),
LocalDateTime.now(),
Expand Down

0 comments on commit efee2ef

Please sign in to comment.