-
Notifications
You must be signed in to change notification settings - Fork 1
[BUILD FAIL] Feature/49 봉사 모집글 조회 기능 #72
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
src/main/java/com/somemore/center/dto/response/CenterInfoResponse.java
Outdated
Show resolved
Hide resolved
| import org.springframework.data.domain.Pageable; | ||
|
|
||
| @Builder | ||
| public record RecruitBoardNearByCondition( |
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.
동적 쿼리 파라미터를 위한 레코드 클래스입니다.
위치 기반 조회 때, keyword = 제목 검색이 있을 수도 없을 수도 있어서 만들어 놨어요.
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.
RecruitBoardSearchCondition 레코드 클래스 보시는게 더 이해하시기 좋을거에요
| @Builder | ||
| @JsonNaming(SnakeCaseStrategy.class) | ||
| @Schema(description = "봉사 모집글 위치 포함 응답 DTO") | ||
| public record RecruitBoardWithLocationResponseDto( |
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.
Response에서 도메인이 많이 엮여있다는게 느껴졌습니다 고생하셨습니다
| QCenter center = QCenter.center; | ||
|
|
||
| Pageable pageable = condition.pageable(); | ||
| BooleanExpression predicate = isNotDeleted(recruitBoard) |
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.
메서드화 시키는것도 괜찮을 것 같아요
| public Optional<RecruitBoard> findById(Long id) { | ||
| return recruitBoardRepository.findById(id); | ||
| public RecruitBoardResponseDto getById(Long id) { | ||
| RecruitBoard recruitBoard = recruitBoardRepository.findById(id).orElseThrow( |
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.
재사용성이 높아보이는 부분이라 메서드로 분리시켜도 좋을것 같다는 생각이 들었습니다
|
|
||
| import com.somemore.center.domain.Center; | ||
|
|
||
| public class CenterFixture { |
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.
Fixture 사용이 편리하지만 몇가지 주의점이 있어서 관련 포스팅 남겨두도록 하겠습니다
범수님이 아닌 다른 팀원분들을 위해 남긴 리뷰입니다!
Fixture 주의사항
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/test/java/com/somemore/recruitboard/controller/RecruitBoardQueryControllerTest.java
Show resolved
Hide resolved
ayoung-dev
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.
너무 고생하셨습니다..👍🏻
src/main/java/com/somemore/center/dto/response/CenterInfoResponse.java
Outdated
Show resolved
Hide resolved
| public static RecruitBoardDetailResponseDto from(RecruitBoardDetail recruitBoardDetail) { | ||
| RecruitBoard board = recruitBoardDetail.recruitBoard(); | ||
| RecruitmentInfo info = board.getRecruitmentInfo(); | ||
| CenterInfoResponse center = CenterInfoResponse.of(board.getCenterId(), | ||
| recruitBoardDetail.centerName()); | ||
| LocationResponseDto location = LocationResponseDto.of( | ||
| recruitBoardDetail.address(), recruitBoardDetail.latitude(), | ||
| recruitBoardDetail.longitude()); |
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.
수고하셨어요 범수 님! 좋은 코드 많이 보고 갑니다.
- 쿼리는 리팩토링이 필요하다고 생각했지만, 우선순위가 아닌 것을 알기에 따로 멘트를 남기지 않았습니다.
- 저는 사실 테스트 코드를 본격적으로 배운 적은 없지만
테스트만을 위한 코드는 존재해서는 안 된다라고 배웠는데 본격적인 테스트를 위해서는 Fixture가 필요한지도 여쭤보고 싶습니다. - mapper 패키지는 repository에서 사용하는 것 같은데 위치가 repository 아래로 가면 어색할까요?
src/main/java/com/somemore/center/dto/response/CenterInfoResponse.java
Outdated
Show resolved
Hide resolved
src/main/java/com/somemore/recruitboard/controller/RecruitBoardQueryController.java
Show resolved
Hide resolved
src/main/java/com/somemore/recruitboard/repository/RecruitBoardRepositoryImpl.java
Outdated
Show resolved
Hide resolved
|
|
||
| import com.somemore.center.domain.Center; | ||
|
|
||
| public class CenterFixture { |
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/test/java/com/somemore/recruitboard/controller/RecruitBoardQueryControllerTest.java
Outdated
Show resolved
Hide resolved
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.
왜 JPA로 바꾸셨는지 여쭤보고 싶습니다
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.
빌드에 실패했습니다.
- 테스트용 메서드는 RecruitBoardJpaRepository 따로 주입 받아서 사용 - ex) saveAndFlush, deleteAllInBatch 등
- 단건 조회 - 페이징 전체 조회 - 페이징 검색 조회 - 페이징 기관 조회 - 페이징 위치 기반 조회
- global/utils -> location/utils
- default 값 사용
- 검색 조건 추가 - 존재하지 않는 기관 아이디로 조회시 검증
- 검색 조건 추가 - 존재하지 않는 기관 아이디로 조회시 검증
- 도메인이 아닌 레포지토리 하위 변경
5c20dd4 to
3ee132e
Compare
|



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