23.03.05
56일차
드디어 완성성했습니다!
저는 하나의 List에 다담을려고 했는데, 그렇게 하지 않고,
댓글 안에 댓글 List를 만들어서 했습니다!
그리고 오래 걸린 이유는 DTO에 담아주지 못해서 였습니다 ㅠㅠㅠ
private List<CommentResponseDto> getComment(Post post) {
List<CommentResponseDto> commentResponseDtoList = new ArrayList<>();
List<Comment> commentList = commentRepository.findAllByPostOrderByCreatedAtDesc(post);
for (Comment c : commentList) {
log.info("comment = {}", c.getComment());
CommentResponseDto commentDto = new CommentResponseDto(c);
List<CommentReply> commentReplyList = commentReplyRepository.findAllByCommentOrderByCreatedAtDesc(c);
for (CommentReply commentReply : commentReplyList) {
log.info("commentReply = {}", commentReply.getCommentReply());
commentDto.addCommentReplies(commentReply);
}
commentResponseDtoList.add(commentDto);
// commentResponseDtoList.add(new CommentResponseDto(c));
// for (CommentReply commentReply : commentReplyList) {
// commentResponseDtoList.add(new CommentResponseDto());
// }
}
// for (CommentReply r : commentReplyList){
// commentReplyResponseDto.add(new CommentReplyResponseDto(r));
// }
return commentResponseDtoList;
}
기술매니저님께 물어볼것!
spring.jpa.hibernate.ddl-auto=create
로 했는데, 게시글만 초기화가 되지 않는다..
// 로그아웃 -> 토큰 무효화, 블랙리스트 방식 구현해보기
현재 채팅 구현중… 살려주세요…
POST
{ "name" : "테스트 채팅방1" }
ws://localhost:8080/ws/chat