77import org .springframework .web .bind .annotation .PathVariable ;
88import org .springframework .web .bind .annotation .PostMapping ;
99import org .springframework .web .bind .annotation .RequestBody ;
10+ import org .springframework .web .bind .annotation .RequestHeader ;
1011import org .springframework .web .bind .annotation .RequestMapping ;
1112import org .springframework .web .bind .annotation .RestController ;
1213
1718import flipnote .notification .application .service .NotificationCommandService ;
1819import flipnote .notification .application .service .NotificationQueryService ;
1920import flipnote .notification .common .response .CursorPagingResponse ;
21+ import flipnote .notification .common .HttpHeaders ;
2022import flipnote .notification .interfaces .rest .docs .NotificationControllerDocs ;
21- import flipnote .notification .interfaces .security .AuthenticatedUser ;
22- import flipnote .notification .interfaces .security .CurrentUser ;
2323import jakarta .validation .Valid ;
2424import lombok .RequiredArgsConstructor ;
2525
@@ -36,10 +36,10 @@ public class NotificationController implements NotificationControllerDocs {
3636 @ GetMapping
3737 public ResponseEntity <CursorPagingResponse <NotificationResponse >> getNotifications (
3838 @ Valid @ ModelAttribute NotificationListRequest req ,
39- @ CurrentUser AuthenticatedUser user
39+ @ RequestHeader ( HttpHeaders . USER_ID ) Long userId
4040 ) {
4141 CursorPagingResponse <NotificationResponse > res
42- = notificationQueryService .getNotifications (user . userId () , req );
42+ = notificationQueryService .getNotifications (userId , req );
4343
4444 return ResponseEntity .ok (res );
4545 }
@@ -48,19 +48,19 @@ public ResponseEntity<CursorPagingResponse<NotificationResponse>> getNotificatio
4848 @ PostMapping ("/token" )
4949 public ResponseEntity <Void > registerFcmToken (
5050 @ Valid @ RequestBody TokenRegisterRequest req ,
51- @ CurrentUser AuthenticatedUser user
51+ @ RequestHeader ( HttpHeaders . USER_ID ) Long userId
5252 ) {
53- fcmTokenService .registerFcmToken (user . userId () , req );
53+ fcmTokenService .registerFcmToken (userId , req );
5454
5555 return ResponseEntity .status (HttpStatus .CREATED ).build ();
5656 }
5757
5858 @ Override
5959 @ PostMapping ("/read-all" )
6060 public ResponseEntity <Void > markAllNotificationsAsRead (
61- @ CurrentUser AuthenticatedUser user
61+ @ RequestHeader ( HttpHeaders . USER_ID ) Long userId
6262 ) {
63- notificationCommandService .markAllNotificationsAsRead (user . userId () );
63+ notificationCommandService .markAllNotificationsAsRead (userId );
6464
6565 return ResponseEntity .ok ().build ();
6666 }
@@ -69,9 +69,9 @@ public ResponseEntity<Void> markAllNotificationsAsRead(
6969 @ PostMapping ("/{notificationId}/read" )
7070 public ResponseEntity <Void > markNotificationAsRead (
7171 @ PathVariable ("notificationId" ) Long notificationId ,
72- @ CurrentUser AuthenticatedUser user
72+ @ RequestHeader ( HttpHeaders . USER_ID ) Long userId
7373 ) {
74- notificationCommandService .markNotificationAsRead (user . userId () , notificationId );
74+ notificationCommandService .markNotificationAsRead (userId , notificationId );
7575
7676 return ResponseEntity .ok ().build ();
7777 }
0 commit comments