동기화
This commit is contained in:
@@ -76,15 +76,17 @@ public class NoticeController {
|
||||
|
||||
@GetMapping("/api/user-notifications/unread-count")
|
||||
@RequirePermission(menu = "NOTICE", perm = "READ")
|
||||
public ApiResponse<Integer> unreadCount(@RequestParam Long userId) {
|
||||
return ApiResponse.ok(service.unreadCount(userId));
|
||||
public ApiResponse<Integer> 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<Void> 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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user