동기화
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user