-
Notifications
You must be signed in to change notification settings - Fork 0
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
코스 조회 paging 추가 #65
Conversation
@AuthenticationPrincipal PrincipalDetails userDetails) { | ||
return BasicResponse.success(courseService.getMemberCourse(userDetails.getUser().getUserId())); | ||
@AuthenticationPrincipal PrincipalDetails userDetails, | ||
@RequestParam(value = "page", defaultValue = "0") Integer page, |
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.
다른건 default가 1인데 얘만 0인 이유가 있을까요?
통일은 1로 하고 page - 1
을 넣는 방식이 좋을것 같아요!
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.
ㅎㅎ제가 실수했습니다
@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)); |
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.
지금 생각해보니 조회 api는 하나로 합칠 수 있을것 같아요
이건 뭐 나중에 리펙토링하는 방향으로 가면 어떨까 싶습니다!
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.
고생하셨습니다!
개요
코스 조회 paging 추가
작업사항
관련 이슈