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

이미지 도메인 추가 및 이미지 저장 #76

Merged
merged 11 commits into from
Feb 20, 2024
Merged

Conversation

jacobhboy
Copy link
Member

@jacobhboy jacobhboy commented Feb 14, 2024

🎫 관련 이슈

close #74


🔨 작업 내용

  • 이미지 추가 및 삭제 구현

🏁 확인 사항

  • 테스트를 완료했나요?
  • API 문서를 작성했나요?
  • 코드 컨벤션을 준수했나요?
  • 불필요한 로그, 주석, import 등을 삭제했나요?

🙋🏻 덧붙일 말

@jacobhboy jacobhboy requested a review from Woongbin06 February 14, 2024 03:27
@jacobhboy jacobhboy self-assigned this Feb 14, 2024
Copy link
Contributor

@Woongbin06 Woongbin06 left a comment

Choose a reason for hiding this comment

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

수고하셨습다

Comment on lines 11 to 18
@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Image {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String fileName;
Copy link
Contributor

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.

s3에 저장된 이미지와 image객체의 생명주기를 똑같이 관리하려고 저렇게 구현했는데, 중간에 방법이 바뀌면서 필요없게 되었네요! 삭제하는 편이 좋을 것 같습니다.

Comment on lines 19 to 21
public void delete(Long id) {
Image byId = imageRepository.getById(id);
amazonS3.deleteObject(s3Bucket.getS3Bucket(), byId.getFileName());
Copy link
Contributor

Choose a reason for hiding this comment

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

Image 객체 이름이 byId보단 image가 좋을 거 같아요

Copy link
Member Author

Choose a reason for hiding this comment

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

@jacobhboy jacobhboy merged commit f0ebc1d into master Feb 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

이미지 도메인 추가 및 이미지 저장
2 participants