Conversation
|
Caution Review failedThe pull request is closed. Walkthrough이 변경사항은 기본 이미지 URL 상수( Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly Related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR refactors the response field structure for group images, removing default images and the isJoined field as discussed in a previous meeting. When no images exist, the backend now returns an empty array images = [] instead of providing default image URLs.
- Updated image upload/creation workflow to use
imageKeyinstead of pre-generated URLs - Removed hardcoded default image URLs from backend code
- Modified test files to use the new imageKey-based approach
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/http/group/v2/v2-group-get.http | Updated to store and use imageKey instead of imageUrl variants; updated test case description for Redis validation |
| src/test/http/group/v2/v2-group-get-list.http | Changed to use imageKey pattern with c_img prefixed variables |
| src/test/http/group/v2/v2-group-create.http | Fixed file extension reference and removed image objects from test request body |
| src/test/http/group/v2/v2-group-attend.http | Updated to use imageKey approach for image handling |
| src/test/http/group/v2/V2-group-cancel.http | Updated to use imageKey approach for image handling |
| src/main/java/team/wego/wegobackend/group/v2/application/service/GroupV2UpdateService.java | Removed default image URL constants and changed to return empty ArrayList when no images exist |
| src/main/java/team/wego/wegobackend/group/v2/application/dto/common/GroupImageItem.java | Removed default image URL constants and simplified defaultLogo() to return null values |
Comments suppressed due to low confidence (1)
src/main/java/team/wego/wegobackend/group/v2/application/service/GroupV2UpdateService.java:150
- The defaultLogoItem() method is no longer used after the refactoring. It was previously called when imageItems was empty, but now an empty ArrayList is returned instead. This method should be removed to eliminate dead code.
private GroupImageItem defaultLogoItem() {
return new GroupImageItem(
null,
"DEFAULT",
0,
List.of(
new GroupImageVariantItem(
null,
GroupImageV2VariantType.CARD_440_240,
GroupImageV2VariantType.CARD_440_240.width(),
GroupImageV2VariantType.CARD_440_240.height(),
ImageV2Format.WEBP,
null
),
new GroupImageVariantItem(
null,
GroupImageV2VariantType.THUMBNAIL_100_100,
GroupImageV2VariantType.THUMBNAIL_100_100.width(),
GroupImageV2VariantType.THUMBNAIL_100_100.height(),
ImageV2Format.WEBP,
null
)
)
);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -109,7 +105,7 @@ public UpdateGroupV2Response update(Long userId, Long groupId, UpdateGroupV2Requ | |||
|
|
|||
| // 이미지가 0개면 기본 이미지(variants 2개) 1장 내려주기 | |||
There was a problem hiding this comment.
The comment states "이미지가 0개면 기본 이미지(variants 2개) 1장 내려주기" (If there are 0 images, return 1 default image with 2 variants), but the code implementation has changed to return an empty ArrayList instead. The comment should be updated to reflect the new behavior of returning an empty array when no images exist.
| // 이미지가 0개면 기본 이미지(variants 2개) 1장 내려주기 | |
| // 이미지가 0개면 빈 리스트를 반환 (기본 이미지는 포함하지 않음) |
| // DB에 이미지가 0개일 때 내려주는 기본 이미지(440/100) | ||
| public static GroupImageItem defaultLogo() { | ||
| return new GroupImageItem( | ||
| null, // DB row가 아니다. 그래서 null | ||
| "DEFAULT", // 테스트 편하게 DEFAULT로 설정 | ||
| 0, // 없으니까 어차피 대표 | ||
| List.of( | ||
| new GroupImageVariantItem( | ||
| null, | ||
| GroupImageV2VariantType.CARD_440_240, | ||
| GroupImageV2VariantType.CARD_440_240.getWidth(), | ||
| GroupImageV2VariantType.CARD_440_240.getHeight(), | ||
| ImageV2Format.WEBP, | ||
| DEFAULT_440 | ||
| ), | ||
| new GroupImageVariantItem( | ||
| null, | ||
| GroupImageV2VariantType.THUMBNAIL_100_100, | ||
| GroupImageV2VariantType.THUMBNAIL_100_100.getWidth(), | ||
| GroupImageV2VariantType.THUMBNAIL_100_100.getHeight(), | ||
| ImageV2Format.WEBP, | ||
| DEFAULT_100 | ||
| ) | ||
| ) | ||
| null, | ||
| null, | ||
| 0, | ||
| null | ||
| ); | ||
| } |
There was a problem hiding this comment.
The defaultLogo() method appears to be dead code after the refactoring. The implementation has been changed to return null values for all fields, making it functionally useless. A search of the codebase shows no references to GroupImageItem.defaultLogo(). This method should be removed.
| "sortOrder": 1, | ||
| "imageKey": "{{img1_key}}" | ||
| } | ||
|
|
There was a problem hiding this comment.
The test uploads two images (img0_key and img1_key) in step 1-1, but then creates a group with an empty images array in step 1-2. This appears to be inconsistent - if the purpose is to test creating a group with imageKeys, the uploaded image keys should be used in the images array. Otherwise, the image upload step (1-1) serves no purpose in this test scenario.
| "{{img0_key}}", | |
| "{{img1_key}}" |
| @@ -29,27 +24,10 @@ public static GroupImageItem from(GroupImageV2 image) { | |||
| // DB에 이미지가 0개일 때 내려주는 기본 이미지(440/100) | |||
There was a problem hiding this comment.
The comment states "DB에 이미지가 0개일 때 내려주는 기본 이미지(440/100)" (Default image to return when there are 0 images in DB), but the implementation has changed and this method now returns all null values. Since this method is no longer used and serves no purpose, the comment is now misleading.
| // DB에 이미지가 0개일 때 내려주는 기본 이미지(440/100) | |
| // 기본 값이 설정되지 않은 빈 GroupImageItem을 반환합니다. |
📝 Pull Request
📌 PR 종류
해당하는 항목에 체크해주세요.
✨ 변경 내용
지난 미팅에서 isJoined와 백엔드에서 기본 이미지를 제거하고 이미지가 존재하지 않으면 images = [] 로 응답하도록 수정했습니다.
🔍 관련 이슈
🧪 테스트
변경된 기능에 대한 테스트 범위 또는 테스트 결과를 작성해주세요.
🚨 확인해야 할 사항 (Checklist)
PR을 제출하기 전에 아래 항목들을 확인해주세요.
🙋 기타 참고 사항
리뷰어가 참고하면 좋을 만한 추가 설명이 있다면 적어주세요.
Summary by CodeRabbit
리팩토링
테스트
✏️ Tip: You can customize this high-level summary in your review settings.