feat: add notification system

This commit is contained in:
Tim
2025-07-02 17:16:42 +08:00
parent 93b14f48e4
commit d6b33e65f4
11 changed files with 248 additions and 10 deletions

View File

@@ -44,8 +44,9 @@ public class PostController {
}
@GetMapping("/{id}")
public ResponseEntity<PostDto> getPost(@PathVariable Long id) {
Post post = postService.getPost(id);
public ResponseEntity<PostDto> getPost(@PathVariable Long id, Authentication auth) {
String viewer = auth != null ? auth.getName() : null;
Post post = postService.viewPost(id, viewer);
return ResponseEntity.ok(toDto(post));
}