Skip to content

Commit

Permalink
💡 Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nowgnas committed Jan 9, 2024
1 parent 9106ad0 commit cda8b16
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import kr.bb.notification.domain.notification.entity.NotificationCommand;
import kr.bb.notification.domain.notification.helper.NotificationQueryActionHelper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequiredArgsConstructor
public class NotificationQueryRestController {
Expand All @@ -18,6 +20,7 @@ public class NotificationQueryRestController {
@GetMapping("/customer")
public CommonResponse<NotificationCommand.NotificationList> getNotificationsCUSTOMER(
@RequestHeader Long userId) {
log.info("userId" + userId);
return CommonResponse.success(
notificationQueryFacadeHandler.getNotifications(userId, Role.CUSTOMER));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import kr.bb.notification.domain.notification.entity.NotificationCommand;
import kr.bb.notification.domain.notification.repository.MemberNotificationJpaRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
Expand All @@ -18,6 +19,7 @@ public class NotificationQueryService {

@Transactional
public NotificationCommand.NotificationList getNotifications(Long userId, Role role) {

List<MemberNotification> notifications =
memberNotificationJpaRepository.findNotifications(userId, role);
List<MemberNotification> notificationsIsRead =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
import kr.bb.notification.domain.notification.application.NotificationQueryService;
import kr.bb.notification.domain.notification.entity.NotificationCommand;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class NotificationQueryActionHelper {
private final NotificationQueryService notificationQueryService;

public NotificationCommand.NotificationList getNotifications(Long userId, Role role) {
log.info("action handler user id " + userId);
return notificationQueryService.getNotifications(userId, role);
}

Expand Down

0 comments on commit cda8b16

Please sign in to comment.