Skip to content

Commit ed87b61

Browse files
committed
remove comment, print
1 parent 27b5c9f commit ed87b61

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

springBootBlog/src/main/java/com/yen/mdblog/controller/PostController.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,11 @@ public String getPaginatedPosts(
106106
public String getPostById(@PathVariable long id, Model model, Principal principal) {
107107

108108
Optional<Post> postOptional = postRepository.findById(id);
109-
110109
if (postOptional.isPresent()) {
111110
model.addAttribute("post", postOptional.get());
112111
model.addAttribute("comment", new CreateComment());
113112
// load comment
114-
// TODO : double check whether should do below here or in CommentController
115113
List<Comment> commentList = commentService.getCommentsByPostId(id);
116-
System.out.println(">>> comment len = " + commentList.size());
117114
// only add to model when comment size > 0
118115
if (commentList.size() > 0){
119116
model.addAttribute("comments", commentList);
@@ -163,7 +160,6 @@ public String createPost(CreatePost request, Model model, Principal principal){
163160
post.setSynopsis(PostUtil.getSynopsis(request.getContent()));
164161
post.setAuthorId(author.getId());
165162
post.setDateTime(LocalDateTime.now());
166-
//post.setAuthorId(authorId);
167163
log.info(">>> request = " + request + " post = " + post + " author = " + author);
168164
log.info(">>>> create post end ...");
169165
postService.savePost(post);
@@ -179,7 +175,6 @@ public String getMyPost(
179175
Model model) {
180176

181177
Author author = authorService.getByName(principal.getName());
182-
183178
// if there is current user has no any post
184179
if (author == null){
185180
model.addAttribute("user", principal.getName());

0 commit comments

Comments
 (0)