Skip to content

Conversation

@nano-mm
Copy link
Collaborator

@nano-mm nano-mm commented Feb 1, 2025

📄 요약(Summary)

팀 현황 페이지 관련 API 구현
✍🏼 상세(More)

PR Desciption

변경 사항 설명

  • 팀 현황 페이지 API에서 담당자별로 작업을 조회하고, 프로필 사진, 닉네임, 부서 정보 등을 포함하여, 작업 개수를 계산하여 반환하는 기능
  • 필터링 및 정렬 기준을 추가하여 사용자가 원하는 형태로 작업을 조회할 수 있도록 구현
  • 정렬 기준은 기여도순(진행 중인 작업 수 + 완료 대기 작업 수) 및 기본(담당자 이름 오름차순)으로 설정하였고, 카테고리 기반 필터링 및 작업 타이틀 검색 기능 구현
  • 작업 목록을 조회할 때, 기본적으로 모든 작업을 조회하며, 필터링 조건에 따라 해당하는 작업만 필터링

Requirements for Reviewer

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

PR Log

PR 작업하면서 고민했던 내용, 해결한 내용, 고민 중인 내용 등

새롭게 배운 것

고민 중인 사항

첨부 자료

Requirements for Reviewer

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

✅ 체크리스트(Checklist)

  • [ ✅] PR 양식에 맞게 작성했습니다
  • 모든 테스트가 통과했습니다
  • [ ✅] 프로그램이 정상적으로 작동합니다
  • [✅ ] 적절한 PR 라벨을 설정했습니다
  • [✅] 불필요한 코드를 제거했습니다

🚪 이슈 번호(Issue numbers)

Closes #31

@nano-mm nano-mm added the ✨ feature 구현·개선 사항에 관련된 내용입니다 label Feb 1, 2025
@nano-mm nano-mm self-assigned this Feb 1, 2025
Comment on lines 15 to 19
@Service
public class TeamStatusService implements LoadTeamStatusUsecase, FilterTeamStatusUsecase {

private final TaskCustomRepository taskCustomRepository;

Copy link
Collaborator

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에서 하는 것이 좋을 것 같습니다.

Comment on lines 45 to 52
@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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

requestparam으로 파라미터 바인딩 후 reqeust 객체를 사용하시는 것보다 modelattribute를 통해 객체의 형태로 사용하셔도 바인딩이 되기 때문에 아래와 같이 사용하는 것을 추천드립니다

ref) https://jaykaybaek.tistory.com/15

Comment on lines +16 to +22
) {
public FilterTeamStatusRequest {
sortBy = (sortBy == null || sortBy.isEmpty()) ? "기본" : sortBy;
mainCategoryIds = mainCategoryIds == null ? List.of() : mainCategoryIds;
categoryIds = categoryIds == null ? List.of() : categoryIds;
taskTitle = taskTitle == null ? "" : taskTitle;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

객체의 형태로 직접 파싱하실 경우 java validation을 사용하시면 좋을 것 같습니다.

Comment on lines 2 to 18

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)
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

이부분은 dto > common > PageResponse에 제가 생성해놓은 포멧을 가져다가 사용하시면 될 것 같습니다.

@parkjaehak
Copy link
Collaborator

jpql 사용한 쿼리 작성을 보았는데 페이징이 담당자별로 이루어지는 것이 아니라 전체 작업에 대한 페이징이 이루어진 후 그룹핑이 되고 있는 것 같은데 테스트해보셨을때 결과가 제대로 나왔을까요?

@parkjaehak
Copy link
Collaborator

parkjaehak commented Feb 2, 2025

제 생각에 현재 작업하신 페이지(팀 현황 조회) 에서는 페이징이 필요없을 것 같고 담당자와 해당하는 작업들만 반환해준뒤 실제 사용자가 특정 담당자의 작업을 스크롤하거나 이동하면 그때 api 호출을 통한 페이징이 필요할 것 같은데 어떻게 생각하시나요

@nano-mm nano-mm merged commit 60cf44e into develop Feb 3, 2025
1 check passed
@joowojr joowojr deleted the CLAP-72-팀-현황-조회-API branch February 3, 2025 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature 구현·개선 사항에 관련된 내용입니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLAP-72 팀 현황 조회 API

3 participants