-
Notifications
You must be signed in to change notification settings - Fork 4
CLAP-72 feat: 팀 현황 조회 API 구현 #206
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
The head ref may contain hidden characters: "CLAP-72-\uD300-\uD604\uD669-\uC870\uD68C-API"
Conversation
| @Service | ||
| public class TeamStatusService implements LoadTeamStatusUsecase, FilterTeamStatusUsecase { | ||
|
|
||
| private final TaskCustomRepository taskCustomRepository; | ||
|
|
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.
port 인터페이스를 정의하시고 port를 구현한 adapter를 생성하시어 실제 repository에 대한 접근은 adapter에서 하는 것이 좋을 것 같습니다.
| @GetMapping("/filter") | ||
| public ResponseEntity<TeamStatusResponse> filterTeamStatus( | ||
| @RequestParam(required = false) List<Long> mainCategoryIds, | ||
| @RequestParam(required = false) List<Long> categoryIds, | ||
| @RequestParam(required = false) String taskTitle, | ||
| @RequestParam(defaultValue = "기본") String sortBy, | ||
| @RequestParam(defaultValue = "0") int page, | ||
| @RequestParam(defaultValue = "20") int pageSize) { |
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.
requestparam으로 파라미터 바인딩 후 reqeust 객체를 사용하시는 것보다 modelattribute를 통해 객체의 형태로 사용하셔도 바인딩이 되기 때문에 아래와 같이 사용하는 것을 추천드립니다
| ) { | ||
| public FilterTeamStatusRequest { | ||
| sortBy = (sortBy == null || sortBy.isEmpty()) ? "기본" : sortBy; | ||
| mainCategoryIds = mainCategoryIds == null ? List.of() : mainCategoryIds; | ||
| categoryIds = categoryIds == null ? List.of() : categoryIds; | ||
| taskTitle = taskTitle == null ? "" : taskTitle; | ||
| } |
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.
객체의 형태로 직접 파싱하실 경우 java validation을 사용하시면 좋을 것 같습니다.
|
|
||
| import java.util.List; | ||
|
|
||
| public record TeamStatusResponse( | ||
| List<TeamMemberTaskResponse> members, | ||
| boolean hasNext, | ||
| boolean isFirst, | ||
| boolean isLast | ||
| ) { | ||
| public TeamStatusResponse(List<TeamMemberTaskResponse> members, int pageNumber, int pageSize) { | ||
| this( | ||
| (members == null) ? List.of() : members, | ||
| (members != null && members.size() > pageSize), | ||
| pageNumber == 0, | ||
| (members == null || members.size() <= pageSize) | ||
| ); | ||
| } |
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 > common > PageResponse에 제가 생성해놓은 포멧을 가져다가 사용하시면 될 것 같습니다.
|
jpql 사용한 쿼리 작성을 보았는데 페이징이 담당자별로 이루어지는 것이 아니라 전체 작업에 대한 페이징이 이루어진 후 그룹핑이 되고 있는 것 같은데 테스트해보셨을때 결과가 제대로 나왔을까요? |
|
제 생각에 현재 작업하신 페이지(팀 현황 조회) 에서는 페이징이 필요없을 것 같고 담당자와 해당하는 작업들만 반환해준뒤 실제 사용자가 특정 담당자의 작업을 스크롤하거나 이동하면 그때 api 호출을 통한 페이징이 필요할 것 같은데 어떻게 생각하시나요 |
📄 요약(Summary)
PR Desciption
Requirements for Reviewer
PR Log
새롭게 배운 것
고민 중인 사항
첨부 자료
Requirements for Reviewer
✅ 체크리스트(Checklist)
🚪 이슈 번호(Issue numbers)
Closes #31