21.12.07 백엔드 코드 리팩토링 1차 완료

This commit is contained in:
jinia91
2021-12-07 11:59:01 +09:00
parent 96b3fa4eee
commit 6da34c0fb8
51 changed files with 442 additions and 318 deletions

View File

@@ -8,7 +8,7 @@ import myblog.blog.article.service.TempArticleService;
import myblog.blog.category.dto.CategoryForView;
import myblog.blog.category.dto.CategoryNormalDto;
import myblog.blog.category.service.CategoryService;
import myblog.blog.comment.dto.CommentDtoForSide;
import myblog.blog.comment.dto.CommentDtoForLayout;
import myblog.blog.comment.service.CommentService;
import myblog.blog.member.auth.PrincipalDetails;
import myblog.blog.member.dto.MemberDto;
@@ -311,10 +311,10 @@ public class ArticleController {
CategoryForView categoryForView = CategoryForView.createCategory(categoryService.getCategoryForView());
model.addAttribute("category", categoryForView);
List<CommentDtoForSide> comments = commentService.recentCommentList()
List<CommentDtoForLayout> comments = commentService.recentCommentList()
.stream()
.map(comment ->
new CommentDtoForSide(comment.getId(), comment.getArticle().getId(), comment.getContent(), comment.isSecret()))
new CommentDtoForLayout(comment.getId(), comment.getArticle().getId(), comment.getContent(), comment.isSecret()))
.collect(Collectors.toList());
model.addAttribute("commentsList", comments);