Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[고도화] 댓글 기능 고도화 - 1차 대댓글 #90

Merged
merged 7 commits into from
Mar 1, 2023

Conversation

GGHDMS
Copy link
Owner

@GGHDMS GGHDMS commented Mar 1, 2023

대댓글 기능 구현

This closes #64

대댓글 도메인 안에서 부모, 자식 관계를 설정하는 코드 추가
부모 엔티티의 상태 변화에 따라 자식 엔티티의 상태를 자동으로 처리하기 위해 cascade 적용
단반향 연관 관계를 적용하기 위해서 자식에서 부모 댓글은 엔티티가 아니라 `Long` id 로 직접 표현

또한 자식 댓글을 추가할 수 있는 메소드 추가
새로 도메인이 바뀌었기 때문에 테스트 데이터를 넣는 쿼리도 변경
또한 jpa 테스트를 통해 사용할 기능들을 미리 테스트
`@ManyToOne` 에 빠져있는 `fetch = FetchType.LAZY ` 추가 해줌
강의에서는 없었지만 내가 했다
`UserAccount` 에서 id 를 string 값으로 입력 받게 바꿔 줬었는데 
dto와 , test 코드에서 반영이 되어 있지 않아 수정

빈칸 제거 및 불필요 코드 제거
부모/ 자식 관계를 만들면서 enity < - > dto 간 변환 로직,
댓글 서비스에서 댓글과 대댓글을 저장하고 삭제하는 방법,
댓글과 대댓글을 db 데이터로부터 변환 할 때
서로 계층 구조를 만들고 각각 정렬하는 과정을 구현
@GGHDMS GGHDMS added the enhancement New feature or request label Mar 1, 2023
@GGHDMS GGHDMS added this to the 게시판 서비스 만들기 milestone Mar 1, 2023
@GGHDMS GGHDMS self-assigned this Mar 1, 2023
Copy link
Owner Author

@GGHDMS GGHDMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GGHDMS GGHDMS merged commit c66e15f into main Mar 1, 2023
@GGHDMS GGHDMS deleted the feature/#64-child-comments branch March 1, 2023 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[고도화] 댓글 기능 고도화 - 1차 대댓글
1 participant