mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 06:50:53 +08:00
feat: add notification system
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user