[로니] 스프링 카페 6단계 - 댓글#147
Open
CMSSKKK wants to merge 12 commits intocodesquad-members-2022:cmsskkkfrom
Open
Conversation
SessionUser, ArticleUpdateDto 구현 equals 메서드 수정 Article 생성자 팩토리 메서드로 수정
댓글 기능 구현을 위한 domain 구현 schema.sql에 cafe_reply table 생성 ddl 작성
HttpSesion에 담긴 user 정보를 담는 모델 구현 기존 UserResponseDto로 담았던 로직을 수정
Reply를 DB에 저장하는 로직을 구현
ArticleController에 ReplyService 필드 추가 qna/show.html에 reply 정보를 출력하도록 수정
ReplyRepository.hasReplyOfAnotherWriter() 메서드 구현 ReplyService.isDelatableArticle() 메서드 구현 ArticleController.checkDeletable() 메서드 구현 SessionUser 수정하지 못하고 빼먹은 부분 수정 MvcConfig addInterceptors 댓글 작성 ,삭제 url pathPattern 추가
data.sql reply의 foreign key로 인해서 테스트를 위한 article insert query 2개 작성
reply 수정 로직을 구현했으나, 실제로 화면에 보이기위해서는 softDeletion이나 다른 필드가 필요할 것 같아서 연결하지는 못하였음 DB 쿼리도 변경이 필요할 것 같아서, 다음단계에서 구현을 목표로 함.
ReplyDto 삭제에 따른 컨트롤러 서비스 수정
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
안녕하세요! 로니입니다.
기능 구현사항
궁금한 점
Exception을 현재ClientException으로 하나만 구현해서, 사용자가 잘못된 요청을 했을 시에 상태코드와 메시지를 그때그때 담아서 처리하고 있습니다. 조금 더 세분화가 필요할까요? 그리고 상태코드와 메시지를enum으로 담아서 재사용하는 것이 좋을까요??로그인 여부에 따라서 기능 사용을
Interceptor를 구현해서, 처리하고 있는데 각각의 url을 interceptorTest를 통해서 하나로 모아서 테스트하는 것이 더 좋을까요? 아니면 각각의 controllerTest에서 로그인정보 여부를 체크해서 성공, 실패 테스트를 각각 만드는 것이 더 좋을까요?