-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor/60 커뮤니티 게시글 조회 기능 리팩토링 #64
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
Conversation
m-a-king
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다. querydsl 한참 생각해 봤는데, 이렇게 사용하는 것이 맞는 것 같습니다!
혹시 나중에 더 알게 되는 정보가 있다면 공유하겠습니다.
|
|
||
| @Getter | ||
| @RequiredArgsConstructor | ||
| public class CommunityBoardWithNickname { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
레코드는 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그리고 이것 자체가 DTO 같은데 추가로 클래스를 만들지 않았다는 PR 포인트가 이해가 잘 안되는데 추가적인 설명을 부탁드리고 싶어요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추가한 클래스는 repository-service에서 사용하는 엔티티? 개념으로 생각했습니다.
그래서 다른 DTO들과는 차이점이 있다고 생각해서 구분지어 말하려했는데 명확하지 않았던 거 같네요
네이밍을 다르게 해야할 거 같은데 뭐가 좋을지 고민이 되네요..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CommunityBoardView를 추천해주는데
다들 어떠신지 이거 보시면 남겨주시면 감사하겠습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 찾아봤는데 마땅히 끌리는게 없어서 아영 님 진행하는대로 따라가게씁니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository-service에서 사용하는 엔티티라면 영속성 레이어의 엔티티라고 보면 되는걸까요?
그럼 서비스로 넘길때 뭔가 비즈니스 레이어에서 사용하는 형태로 변형시켜줘야 되는지도 궁금해요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DB 테이블이랑 직접 매핑되지 않기도 하고 객체 같은 느낌이라 영속성 엔티티라고 보긴 어려울 거 같아요...
그럼.. repository-service단에서 사용하는 DTO라고 하는게 맞을까요?
지금은 기존 entity-dto 처럼 서비스에서 dto로 변환하고 있습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 지금 괜찮아보입니다.!
서로다른 두가지 테이블에 있는 데이터를 묶어주기 위한 엔티티로 보이네요
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| public record CommunityBoardGetDetailResponseDto( | ||
| Long id, | ||
| UUID writerId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volunteerId보다 writerId가 좋을까요? 사실 저도 모르겠어요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시나 추후에 센터도 작성 가능하게 될 걸 고려해서 바꾸지 않았는데 volunteerId로 바꾸는게 나을까요?
저도 고민되어서 바꾸지 않고 그냥 뒀습니다..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이것도 자유롭게 결정해주셔도 될 것 같아요
src/main/java/com/somemore/community/repository/CommunityRepositoryImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/com/somemore/community/service/CommunityBoardQueryService.java
Show resolved
Hide resolved
|
고생하셨습니다! branch is out-of-date with the base branch가 나오는데 리베이스 한번 해주시면 사라질 것 같습니다 |
- entity -> dto 메서드 추출 - CommunityBoardView record로 변경 - CommunityBoard 조회 쿼리 추출
leebs0521
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다.
|
|
||
| @Getter | ||
| @RequiredArgsConstructor | ||
| public class CommunityBoardWithNickname { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 지금 괜찮아보입니다.!
서로다른 두가지 테이블에 있는 데이터를 묶어주기 위한 엔티티로 보이네요
| .selectFrom(communityBoard) | ||
| .select(Projections.constructor(CommunityBoardWithNickname.class, | ||
| communityBoard, | ||
| volunteer.nickname)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
감사합니다... 이 방법 전 좋아요
…project/WEB1_1_Bongdari_BE into refactor/60-modify-community-board-query # Conflicts: # src/main/java/com/somemore/community/service/CommunityBoardQueryService.java
|
m-a-king
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!!!



resolved :
👩💻 요구 사항과 구현 내용
✅ PR 포인트 & 궁금한 점