동기화

This commit is contained in:
GA Pro
2026-05-14 01:22:47 +09:00
parent 958fe6b980
commit c0105c6847
@@ -76,15 +76,17 @@ public class NoticeController {
@GetMapping("/api/user-notifications/unread-count") @GetMapping("/api/user-notifications/unread-count")
@RequirePermission(menu = "NOTICE", perm = "READ") @RequirePermission(menu = "NOTICE", perm = "READ")
public ApiResponse<Integer> unreadCount(@RequestParam Long userId) { public ApiResponse<Integer> unreadCount(@RequestParam(required = false) Long userId) {
return ApiResponse.ok(service.unreadCount(userId)); Long target = userId != null ? userId : SecurityUtil.getCurrentUserId();
return ApiResponse.ok(service.unreadCount(target));
} }
@PostMapping("/api/user-notifications/{notificationId}/read") @PostMapping("/api/user-notifications/{notificationId}/read")
@RequirePermission(menu = "NOTICE", perm = "READ") @RequirePermission(menu = "NOTICE", perm = "READ")
public ApiResponse<Void> markRead(@PathVariable Long notificationId, public ApiResponse<Void> markRead(@PathVariable Long notificationId,
@RequestParam Long userId) { @RequestParam(required = false) Long userId) {
service.markRead(notificationId, userId); Long target = userId != null ? userId : SecurityUtil.getCurrentUserId();
service.markRead(notificationId, target);
return ApiResponse.ok(); return ApiResponse.ok();
} }