-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: 이미지 순서 수정 시 반영 안되는 문제 #650 #651
fix: 이미지 순서 수정 시 반영 안되는 문제 #650 #651
Conversation
Test Results 36 files 36 suites 6s ⏱️ Results for commit 48ad868. ♻️ This comment has been updated with latest results. |
🌻Test Coverage Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다, 호티! 코멘트 한번씩 확인해주세요.
반대 의견의 코멘트도 대환영입니다.
backend/src/test/java/com/staccato/moment/domain/MomentImagesTest.java
Outdated
Show resolved
Hide resolved
backend/src/test/java/com/staccato/moment/domain/MomentImagesTest.java
Outdated
Show resolved
Hide resolved
backend/src/test/java/com/staccato/moment/domain/MomentImagesTest.java
Outdated
Show resolved
Hide resolved
public List<MomentImage> existingImages() { | ||
return momentImages.getImages(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public String getThumbnailUrl() {
return momentImages.getImages().get(0).getImageUrl();
}
이 클래스에 있는 다른 메서드(위의 getThumbnailUrl
)처럼, 앞에 get
을 붙여서 getExistingImages
로 하는 것도 좋을 것 같아요.
필드명이 momentImages
라서 lombok을 통해 생성된 getter와의 충돌은 없는 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드의 일관성 측면에서 get을 쓴부분이 있다면 getXXX로 맞추는 것이 합리적이라고 생각합니다.
그렇다면 혹시 getThumbnailUrl
을 thumbnailUrl
로 변경하는 것은 어떨까요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lombok을 사용해서 다른 부분에서도 get을 사용하지 않고 필드명으로 가져오다보니, 그렇게 통일성을 맞추는 것도 좋다고 생각합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
이미 존재하는 이미지까지 모두 삭제하고 다시 업로드한다는 점은 비효율적이지만, 우선 가장 간단한 해결 방법인 것 같아요! (S3에 너무 많은 이미지가 생길수도 있을 것 같네요!)
추후에 개선 방안 같이 고민해봅시다:)
|
||
private boolean contains(MomentImage momentImage) { | ||
return this.images.stream() | ||
.anyMatch(image -> image.isSame(momentImage)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MethodSource
에서 사용되는 메서드 위치 코멘트만 한번 확인해주세요. 수고하셨습니다, 호티!
assertThat(images).containsExactlyElementsOf(updatedImageNames); | ||
} | ||
|
||
static Stream<Arguments> provideUpdateData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
보통 @MethodSource
로 사용하는 메서드들은 맨 위에 모아놓더라구요.
찾아보니까 MethodSource는 클래스 레벨에서 미리 접근 가능한 상태를 만들기 위해 static
이 붙여졌고, 일반적으로 static 메서드는 클래스의 맨 위에 모아서 관리하기 때문에 그렇게 된 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영했씁니다!
⭐️ Issue Number
🚩 Summary
🛠️ Technical Concerns
🙂 To Reviewer
📋 To Do