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

Feature/get ootds(#116) #118

Merged
merged 9 commits into from
Feb 19, 2024
Merged

Feature/get ootds(#116) #118

merged 9 commits into from
Feb 19, 2024

Conversation

jinhoon227
Copy link
Collaborator

@jinhoon227 jinhoon227 commented Feb 18, 2024

변경 사항

  • 댓글 작성자 nullable 하게 수정
  • User 도메인에 팔로워 확인 여부, 키 가져오기, 몸무게 가져오기 기능 추가(OOTD 상세페이지 조회에 사용하기위해)
  • Ootd 공개여부 및 글 수정 기능에 대해 공개여부만 수정가능하도록 변경(디자인에서 결정된대로)
  • 현재 Ootd 작성자의 다른 Ootd 정보 제공 기능 추가(OOTD 상세페이지에 사용)
  • 현재 Ootd 와 비슷한 스타일 Ootd 정보 제공 기능 추가(OOTD 상세페이지에 사용)
  • 추가된 기능 및 OOTD 단건 조회에 대한 테스트 추가
  • 공용 Slice 반환 클래스 추가

참고 사항

댓글 작성자를 nullable 하게 수정했습니다. 댓글은 다른 기능과는 다르게 삭제되어도 "자식댓글이 존재하는 부모댓글" 일 경우 "삭제된 댓글입니다" 로 보여주어야 합니다. 그렇기에 사용자가 "완전 탈퇴" 를 했어도 해당 사용자가 작성한 Comment 를 DB 에서 지울 수 없습니다. 그러므로 사용자가 완전 탈퇴시 Comment 엔티티의 작성자 필드를 null 로 변경하는것으로 대체합니다.

현재 Ootd 작성자의 다른 Ootd 정보제공, 현재 Ootd 와 비슷한 스타일 Ootd 정보 제공의 경우 페이지네이션을 적용해 현재 10개씩 조회, 작성 내림차순으로 조회하도록 하였습니다.

close #116

@jinhoon227 jinhoon227 added the enhancement New feature or request label Feb 18, 2024
@jinhoon227 jinhoon227 self-assigned this Feb 18, 2024
Copy link
Collaborator

@kkmin223 kkmin223 left a 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) {
Copy link
Collaborator

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,
Copy link
Collaborator

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

@jinhoon227 jinhoon227 requested a review from kkmin223 February 19, 2024 14:42
Copy link
Collaborator

@kkmin223 kkmin223 left a comment

Choose a reason for hiding this comment

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

승인합니다

@jinhoon227 jinhoon227 merged commit 5b2e927 into main Feb 19, 2024
1 check passed
@jinhoon227 jinhoon227 deleted the feature/get-ootds(#116) branch February 19, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OOTD의 다른 OOTD 조회, OOTD 의 비슷한 OOTD 조회 추가
2 participants