Add post and comment deletion

This commit is contained in:
Tim
2025-07-11 17:24:48 +08:00
parent 216faeb496
commit f4af7a48c7
7 changed files with 139 additions and 3 deletions

View File

@@ -65,6 +65,11 @@ public class CommentController {
return dto;
}
@DeleteMapping("/comments/{id}")
public void deleteComment(@PathVariable Long id, Authentication auth) {
commentService.deleteComment(auth.getName(), id);
}
private CommentDto toDto(Comment comment) {
CommentDto dto = new CommentDto();
dto.setId(comment.getId());