Skip to content

Conversation

@parkjaehak
Copy link
Collaborator

@parkjaehak parkjaehak commented Jan 23, 2025

📄 요약(Summary)

요청한 작업에 대해 수정합니다.

✍🏼 상세(More)

PR Desciption

  • task id 를 통해 기존 task을 가져온 후 새로운 데이터로 변경합니다.
  • Attachment id 에 해당하는 모든 attachment를 삭제합니다.
  • 새로운 데이터를 통해 attachment 엔티티를 생성하고 task와 연관관계를 설정 후 저장합니다.

Requirements for Reviewer

  • attachment id에 task id가 fk로 걸려있고 task id에 해당하는 attachment를 모두 지우려고 하였으나 comment id를 fk로 가진 attachment도 있기 때문에 위에 설명한 방법대로 진행하였습니다.
  • 현재 업데이트 된 attachment에 데이터를 받을 때 fileId와 fileUrl 만을 전달받고 있고 originalName과 fileSize는 하드코딩하여 임시로 저장하고 있습니다. originalName과 fileSize도 클라이언트로부터 전달받아야 할 것 같습니다.

PR Log

PR 작업하면서 고민했던 내용, 해결한 내용, 고민 중인 내용 등

새롭게 배운 것

  • task id를 통해 db 데이터를 TaskEntity로 영속화하는데 ddd에 따라 Task Domain으로 전환 후 도메인의 수정을 통해 다시 save를 호출하는 방식으로 하면 영속성 컨텍스트에서 벗어나 save 시점에 새로운 엔티티로 영속화되는 것은 아닐지 가능할지 의문이 들었습니다.
  • taskEntity에서 task 도메인으로 할당되면 기존 taskEntity는 detach 상태로 전환되고 task 도메인에서 id가 할당된 taskEntity로 전환 후 save하게 되면 해당 id를 key로 하는 엔티티가 있는지 확인한 후 있으면 merge하고 없으면 persist하는 과정으로 진행되기 때문에 문제가 없다는 것을 알게 되었습니다.

고민 중인 사항

첨부 자료

Requirements for Reviewer

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

✅ 체크리스트(Checklist)

  • PR 양식에 맞게 작성했습니다
  • 모든 테스트가 통과했습니다
  • 프로그램이 정상적으로 작동합니다
  • 적절한 PR 라벨을 설정했습니다
  • 불필요한 코드를 제거했습니다

🚪 이슈 번호(Issue numbers)

Closes #15

@parkjaehak parkjaehak self-assigned this Jan 23, 2025
@parkjaehak parkjaehak added ✨ feature 구현·개선 사항에 관련된 내용입니다 HIGH 우선순위 상 labels Jan 23, 2025
@parkjaehak parkjaehak force-pushed the CLAP-58 branch 3 times, most recently from b3da5c1 to 8206952 Compare January 23, 2025 06:34
Copy link
Contributor

@joowojr joowojr left a comment

Choose a reason for hiding this comment

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

수고하셨습니다! 리뷰 확인해주세요

Copy link
Contributor

Choose a reason for hiding this comment

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

mapper에서는 필드의 매핑 기능 정도만 수행하고, 비즈니스 로직은 도메인 레이어로 옮겨야할거 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

같은 dto 형식이라도 dto는 API마다 분리해주시면 좋을것 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

검색 및 필터링의 경우는 Search, Filter, 단순 조회의 경우 Get 등의 네이밍이 좋을 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

108번 브랜치에서 반영하겠습니다.

@parkjaehak parkjaehak merged commit db0a7f5 into develop Jan 23, 2025
1 check passed
@parkjaehak parkjaehak deleted the CLAP-58 branch February 3, 2025 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature 구현·개선 사항에 관련된 내용입니다 HIGH 우선순위 상

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLAP-58 요청 수정 API

3 participants