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

[feat] 북토크 개설 관련 API 구현 #36

Merged
merged 17 commits into from
Jul 11, 2023
Merged

Conversation

onpyeong
Copy link
Member

📌 관련 이슈

close #33

✨ 과제 내용

  • POST 북토크 개설하기
    • 작가 이외에는 북토크 개설 버튼이 있는 뷰에 진입할 수 없다고 해서 따로 작가인지 확인은 안했는데 괜찮은지 궁금합니다!
  • PATCH 북토크 수정하기
    • PATCH할 때 수정할 속성만 보낼 경우, null check를 하기 까다로운 부분도 있고 클라에서도 사용자가 어떤 값을 변경했는지 판단하는게 더 복잡하다고 해서 모든 속성을 보내도록 구현했습니다!
  • DELETE 북토크 삭제하기
  • GET 북토크 상세 조회하기

궁금증

  • DTO 형태가 모두 다르기는 한데 일정부분 겹치는 부분이 있어서 이걸 어떻게 더 효율적으로 할 수 있는지 궁금합니다!

@onpyeong onpyeong requested a review from dong2ast July 10, 2023 20:56
@onpyeong onpyeong self-assigned this Jul 10, 2023
Copy link
Collaborator

@dong2ast dong2ast left a comment

Choose a reason for hiding this comment

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

DTO 부분은 사람마다 견해가 다르긴 한데 일단 저는 웬만하면 분리하는게 좋다고 들었습니다!
코드의 가독성(명확성)과 유지보수 측면에서 장점이 있다 해서요!
그 외에는 하나의 공통된 Dto 내에 Inner Class를 만들어 관리하는게 있는데 그거는 논의해보고 정하면 좋을 것 같아요~

Copy link
Collaborator

@dong2ast dong2ast left a comment

Choose a reason for hiding this comment

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

아 그리고 이거는 추가로 dto 폴더링 할 때 고민했던 건데 도메인과 관련된 dto는 도메인 폴더 아래에 dto에 폴더를 파서 넣고, 그 외의 것들은 Controller 등 해당 계층 내 dto 폴더에 두는게 좋을 것 같은데 어떻게 생각하시나요?

Copy link
Collaborator

@dong2ast dong2ast left a comment

Choose a reason for hiding this comment

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

우선 저도 북토크로 작업해야하니 승인하고 merge하겠습니다~
추후 수정내용은 다시 refactor 해주세요!
그리고 TODO가 나중에 해야할 일 이라는 의미로 쓰인건지도 개인적으로 궁금했습니다 :)

@Transactional
public BooktalkCreateResponseDto createBooktalk(BooktalkRequestDto booktalkRequestDto) {
Place place = getPlaceById(booktalkRequestDto.getPlaceId());
//작가인지 확인할 필요가 있는지?
Copy link
Collaborator

Choose a reason for hiding this comment

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

안 해도 되지만 해도 나쁠 건 없다는 생각입니다~

@Transactional
public BooktalkUpdateDto updateBooktalk(Long booktalkId, BooktalkUpdateDto booktalkUpdateDto) {
Booktalk booktalk = getBooktalkById(booktalkId);
if (booktalkUpdateDto.getPlaceId() != booktalk.getPlace().getId()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

이거는 장소 업데이트로 이해 했는데,

  1. 북토크의 기존 정보도 Dto에 같이 넘어오는 구조인지?
  2. 그렇다면 장소가 기존과 달라지는지를 체크 안 하고 그냥 장소 id도 같이 패치시키면 되는거 아닌지?
    가 궁금합니다~

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. 기본 정보도 같이 넘어오는게 맞습니다!
  2. 오 그렇네유 ㅋㅋㅋㅋ 수정하겠습니다!

public BooktalkDeleteResponseDto deleteBooktalk(Long booktalkId) {
Booktalk booktalk = getBooktalkById(booktalkId);
//TODO soft delete?
//공간이 거절 됐거나 공간 매칭중일 때만 삭제가능
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 내용은 혹시 어디에 구현되었나요??

Copy link
Member Author

Choose a reason for hiding this comment

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

z클라 단에서 북토크 상태를 보고 삭제 버튼을 안보이게 한다고 해서 delete 요청 자체가 안들어오게 될거 같아서 따로 처리를 안했습니다!

@dong2ast dong2ast self-requested a review July 11, 2023 04:31
@onpyeong
Copy link
Member Author

DTO 부분 제외하고 코드리뷰 반영했습니다!
TODO는 추후 할 일 맞아요!

@dong2ast dong2ast merged commit 179269b into main Jul 11, 2023
1 check passed
@dong2ast dong2ast deleted the feat/#33-open-booktalk branch July 11, 2023 08:53
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.

[feat] 북토크 개설 관련 API 구현
2 participants