-
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
Feature/get ootds(#116) #118
Conversation
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.
컨트롤러에서 요청 받는 부분 확인 부탁드립니다!
@@ -83,9 +85,9 @@ public ApiResponse<OotdGetRes> getOotdPost(@PathVariable Long id) { | |||
|
|||
@Operation(summary = "ootd 전체 조회", description = "최신순으로 ootd를 조회 api") | |||
@GetMapping("/all") | |||
public ApiResponse<List<OotdGetAllRes>> getOotdPosts() { | |||
public ApiResponse<SliceImpl<OotdGetAllRes>> getOotdPosts(@RequestParam("page") 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.
제가 조회할 때 공용으로 쓸려고 CommonPageRequest 클래스 만들어놨는데, 이거 쓰는건 어떨까요?
default 값 맵핑 해놔서 page만 입력 받으면, 다른 값들은 default 값으로 페이징 쓸 수 있도록 만들었습니다~
@Operation(summary = "ootd 작성자의 다른 ootd", | ||
description = "상세페이지에서 ootdId 와 writerId 를 주면 해당 작성자의 다른 ootd 사진을 제공합니다.") | ||
@GetMapping("/other") | ||
public ApiResponse<SliceImpl<OotdGetOtherRes>> getOtherOotd(@RequestParam("user") Long userId, |
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.
Get 요청일 때 쿼리 스트링 객체로 받으려면 @ModelAttribute 어노테이션 붙이거나, 그냥 아무것도 안붙이면 객체로 받을 수 있습니다!
해당 객체에는 Setter or 생성자 추가가 필요합니다!
@RequestParam vs @ModelAttribute
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.
승인합니다
변경 사항
참고 사항
댓글 작성자를 nullable 하게 수정했습니다. 댓글은 다른 기능과는 다르게 삭제되어도 "자식댓글이 존재하는 부모댓글" 일 경우 "삭제된 댓글입니다" 로 보여주어야 합니다. 그렇기에 사용자가 "완전 탈퇴" 를 했어도 해당 사용자가 작성한 Comment 를 DB 에서 지울 수 없습니다. 그러므로 사용자가 완전 탈퇴시 Comment 엔티티의 작성자 필드를 null 로 변경하는것으로 대체합니다.
현재 Ootd 작성자의 다른 Ootd 정보제공, 현재 Ootd 와 비슷한 스타일 Ootd 정보 제공의 경우 페이지네이션을 적용해 현재 10개씩 조회, 작성 내림차순으로 조회하도록 하였습니다.
close #116