diff --git a/ga-api/src/main/java/com/ga/api/controller/notice/NoticeController.java b/ga-api/src/main/java/com/ga/api/controller/notice/NoticeController.java index edd9fb3..5199c11 100644 --- a/ga-api/src/main/java/com/ga/api/controller/notice/NoticeController.java +++ b/ga-api/src/main/java/com/ga/api/controller/notice/NoticeController.java @@ -76,15 +76,17 @@ public class NoticeController { @GetMapping("/api/user-notifications/unread-count") @RequirePermission(menu = "NOTICE", perm = "READ") - public ApiResponse unreadCount(@RequestParam Long userId) { - return ApiResponse.ok(service.unreadCount(userId)); + public ApiResponse unreadCount(@RequestParam(required = false) Long userId) { + Long target = userId != null ? userId : SecurityUtil.getCurrentUserId(); + return ApiResponse.ok(service.unreadCount(target)); } @PostMapping("/api/user-notifications/{notificationId}/read") @RequirePermission(menu = "NOTICE", perm = "READ") public ApiResponse markRead(@PathVariable Long notificationId, - @RequestParam Long userId) { - service.markRead(notificationId, userId); + @RequestParam(required = false) Long userId) { + Long target = userId != null ? userId : SecurityUtil.getCurrentUserId(); + service.markRead(notificationId, target); return ApiResponse.ok(); }