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: team image #253

Merged
merged 7 commits into from
Nov 6, 2024
Merged

Feat: team image #253

merged 7 commits into from
Nov 6, 2024

Conversation

lee-haeseung
Copy link
Member

@lee-haeseung lee-haeseung commented Oct 30, 2024

#️⃣연관된 이슈

📝작업 내용

팀 프로필 및 배너 이미지에 대한 작업을 진행했습니다!
기존에는 GET에 대한 코드도 있었는데, 팀 정보 조회할 때 이미지 정보는 같이 반환하면 될 것 같아 따로 제작하지 않았습니다.

🔎코드 설명 및 참고 사항

이미지가 존재하는 상태에서 새로운 이미지를 업로드 하는 경우,
기존 이미지를 삭제하고 새 이미지로 대체합니다.
이 때, 삭제가 즉시 이루어지지 않아 데이터베이스에 중복 키 오류가 발생하여 flush를 이용해주었습니다!
image
관련하여 다른 좋은 방법이 있다면 말씀해주세요!

uuid의 경우, 이미지를 저장할 때 활용하는데,
팀 관련 이미지, 사용자 관련 이미지, 게시물 관련 이미지에서 사용되어 common으로 위치 옮겨주었습니다!
image

💬리뷰 요구사항

팀의 경우, 검증 로직이 다 동일한 것 같아서 (멤버 확인 -> 팀 확인 -> 팀 멤버인지 확인)
image
각각의 메소드마다 똑같은 로직을 작성해야 하는지 의문입니다...!
따로 검증 method를 만들어서 관리할 필요는 없을까요?

- 생성 혹은 갱신
- 삭제
API 구현

uuid에 대한 처리 이후에 진행할 예정
어떤 DTO 사용하는지 명시해주었고
ModelAttribute 사용해서 이미지 받을 수 있게 구현
team과의 연결 끊고 flush를 통해 repository의 삭제 요청을 즉시 수행
@lee-haeseung lee-haeseung added the ✨ Feature 기능 개발 label Oct 30, 2024
@lee-haeseung lee-haeseung self-assigned this Oct 30, 2024
@lee-haeseung lee-haeseung linked an issue Oct 30, 2024 that may be closed by this pull request
Copy link
Member

@yumzen yumzen 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
Member

Choose a reason for hiding this comment

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

이렇게하면 flush()를 한번 더 하게 되니까 delete없이 이미지 url만 수정할 수 있도록 하는 것도 가능한가요??

Copy link
Member Author

Choose a reason for hiding this comment

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

그 생각을 못했네요...! 해당 방식으로 다시 구현 해보겠습니다

@lee-haeseung lee-haeseung requested a review from yumzen October 31, 2024 16:00
Copy link
Member

@yumzen yumzen left a comment

Choose a reason for hiding this comment

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

아주 좋습니다! 수고했어요

@lee-haeseung lee-haeseung merged commit 4b82d76 into develop Nov 6, 2024
1 check passed
@lee-haeseung lee-haeseung deleted the feature/#252-team-image branch November 10, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: 팀 이미지 CRUD 개발
2 participants