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

코스 조회 paging 추가 #65

Merged
merged 8 commits into from
Feb 12, 2024
Merged

코스 조회 paging 추가 #65

merged 8 commits into from
Feb 12, 2024

Conversation

haeun-i
Copy link
Collaborator

@haeun-i haeun-i commented Feb 12, 2024

개요

코스 조회 paging 추가

작업사항

  • 코스 조회 로직에 paging 추가
  • 관련 작업으로 인한 테스트코드 변경

관련 이슈

@haeun-i haeun-i requested a review from emost22 February 12, 2024 11:22
@haeun-i haeun-i self-assigned this Feb 12, 2024
@AuthenticationPrincipal PrincipalDetails userDetails) {
return BasicResponse.success(courseService.getMemberCourse(userDetails.getUser().getUserId()));
@AuthenticationPrincipal PrincipalDetails userDetails,
@RequestParam(value = "page", defaultValue = "0") Integer page,
Copy link
Member

Choose a reason for hiding this comment

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

다른건 default가 1인데 얘만 0인 이유가 있을까요?
통일은 1로 하고 page - 1을 넣는 방식이 좋을것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ㅎㅎ제가 실수했습니다

Comment on lines 59 to 83
@GetMapping("/all")
public BasicResponse<CourseGetResList> getAllCourses(
@AuthenticationPrincipal PrincipalDetails userDetails) {
return BasicResponse.success(courseService.getAllCourse(userDetails.getUser().getUserId()));
@AuthenticationPrincipal PrincipalDetails userDetails,
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit) {
return BasicResponse.success(
courseService.getAllCourse(userDetails.getUser().getUserId(), page, limit));
}

@GetMapping("/owner")
public BasicResponse<CourseGetResList> getOwnedCourses(
@AuthenticationPrincipal PrincipalDetails userDetails) {
return BasicResponse.success(courseService.getOwnedCourse(userDetails.getUser().getUserId()));
@AuthenticationPrincipal PrincipalDetails userDetails,
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit) {
return BasicResponse.success(
courseService.getOwnedCourse(userDetails.getUser().getUserId(), page, limit));
}

@GetMapping("/member")
public BasicResponse<CourseGetResList> getMemberCourses(
@AuthenticationPrincipal PrincipalDetails userDetails) {
return BasicResponse.success(courseService.getMemberCourse(userDetails.getUser().getUserId()));
@AuthenticationPrincipal PrincipalDetails userDetails,
@RequestParam(value = "page", defaultValue = "0") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit) {
return BasicResponse.success(
courseService.getMemberCourse(userDetails.getUser().getUserId(), page, limit));
Copy link
Member

Choose a reason for hiding this comment

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

지금 생각해보니 조회 api는 하나로 합칠 수 있을것 같아요
이건 뭐 나중에 리펙토링하는 방향으로 가면 어떨까 싶습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵 추후에 시간이 된다면 바꾸겠습니다

Copy link
Member

@emost22 emost22 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@haeun-i haeun-i merged commit 6eecb65 into develop Feb 12, 2024
1 check passed
@haeun-i haeun-i deleted the feature/64-course branch February 12, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

코스 조회 pageNation 추가
2 participants