Open
Conversation
- 요구사항 필드 추가 - 게시글에 포함된 댓글도 조회 가능해야 하기 때문에 양방향 매핑 설정
- build.gradle에 의존성 추가 - yml 설정 추가 - @EnableJpaAuditing 추가
- jpa auditing 어노테이션 추가
- responseDto : 응답 dto 필드값 설정 (id, title, content) - requestDto : 요청 dto 필드값 설정, entity 변환 메서드 추가
- 요청값을 엔티티로 변환 후 DB 저장 - 매퍼파일에서 다시 dto로 변환 후 반환
- PostJpaRepository, PostRepository, PostRepositoryImpl를 분리해서 4계층 아키텍쳐에 맞게 분리
- controller에 엔트포인트 추가
- http client test 완료
- jpa auditing 어노테이션 추가
- responseDto : 응답 dto 필드값 설정 - requestDto : 요청 필드값 설정 및 엔티티로 변환 메서드 추가
- post의 아이디를 받아와서 db에서 찾은 뒤, comment의 요청dto를 엔티티로 변환하는 과정에 넘겨줌 - comment의 db에 저장 (post의 id값 포함)
- 4계층 아키텍쳐에 맞게 분리
- 엔티티를 dto로 변환 후 반환
- comment 엔트포인트 추가
- http client test 완료
- findByPostId를 하여 comment 생성에 값 추가
- 게시글 조회 엔드포인트 추가
- 응답 dto 필드 (id, title, content, createdAt, commentList)
- PostMapper : dto로 변환 메서드 추가
- 엔티티를 응답 dto로 변환
- commentList도 dto로 응답 (엔티티가 노출되면 안됨)
- commentResponse도 dto로 변환
- 삭제된 게시글은 조회 불가 > 예외처리
- http client test 완료
- 게시물 수정 엔드포인트 추가
- post 엔티티 내 update 메서드 추가 - 삭제된 게시글 수정 불가 예외처리 - jpa 더티체킹으로 인해 자동으로 수정사항이 업데이트됨
- 응답, 요청 dto 필드 : title, content - PostMapper : 엔티티를 dto로 변환
- http client test
- 댓글 수정 엔트포인트 추가
- comment 엔티티 내 update 메서드 추가 - 삭제된 댓글 수정 불가 예외 처리 - jpa 더티체킹으로 인해 자동으로 수정됨
- comment 필드만 수정 가능
- db에서 commentId 가져오는 로직 추가
- 엔티티를 dto로 변환 로직 추가
- http client test 완료
- 엔드포인트 추가
- 엔티티 클래스에 softDelete 메서드 추가 - 이미 삭제된 게시물 삭제 불가 예외처리
- 엔티티를 응답 dto로 변환
- http client test 완료
- 엔드 포인트 추가
- comment 엔티티 클래스에 softDelete 메서드 추가 - 이미 삭제된 댓글 예외 처리 - jpa 더티체킹으로 인해 자동 수정 반영
- 응답 dto 필드 추가 - CommentMapper : 엔티티를 dto로 변환
- http client test 완료
- dto를 comment와 post로 분리
- create > update 수정
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.
과제 제출합니다