Skip to content

Response 필드 구성 일부 리팩토링#146

Merged
LimdaeIl merged 2 commits intomainfrom
feat/response
Dec 22, 2025
Merged

Response 필드 구성 일부 리팩토링#146
LimdaeIl merged 2 commits intomainfrom
feat/response

Conversation

@LimdaeIl
Copy link
Collaborator

@LimdaeIl LimdaeIl commented Dec 22, 2025

📝 Pull Request

📌 PR 종류

해당하는 항목에 체크해주세요.

  • 기능 추가 (Feature)
  • 버그 수정 (Fix)
  • 문서 수정 (Docs)
  • 코드 리팩터링 (Refactor)
  • 테스트 추가 (Test)
  • 기타 변경 (Chore)

✨ 변경 내용

지난 미팅에서 isJoined와 백엔드에서 기본 이미지를 제거하고 이미지가 존재하지 않으면 images = [] 로 응답하도록 수정했습니다.

🔍 관련 이슈

🧪 테스트

변경된 기능에 대한 테스트 범위 또는 테스트 결과를 작성해주세요.

  • 유닛 테스트 추가 / 수정
  • 통합 테스트 검증
  • 수동 테스트 완료

🚨 확인해야 할 사항 (Checklist)

PR을 제출하기 전에 아래 항목들을 확인해주세요.

  • 코드 포매팅 완료
  • 불필요한 파일/코드 제거
  • 로직 검증 완료
  • 프로젝트 빌드 성공
  • 린트/정적 분석 통과 (해당 시)

🙋 기타 참고 사항

리뷰어가 참고하면 좋을 만한 추가 설명이 있다면 적어주세요.

Summary by CodeRabbit

  • 리팩토링

    • 그룹 이미지 처리를 개선하여 이미지 URL 대신 이미지 키 기반 관리로 변경했습니다.
    • 기본 이미지 생성 로직을 제거하여 이미지가 없을 때 빈 목록을 반환하도록 업데이트했습니다.
  • 테스트

    • 이미지 키 기반 접근 방식을 반영하도록 그룹 관련 테스트를 업데이트했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@LimdaeIl LimdaeIl self-assigned this Dec 22, 2025
Copilot AI review requested due to automatic review settings December 22, 2025 01:42
@LimdaeIl LimdaeIl added the ✨enhancement New feature or request label Dec 22, 2025
@LimdaeIl LimdaeIl moved this from Backlog to In progress in WeGo-Together Backend Dec 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

이 변경사항은 기본 이미지 URL 상수(DEFAULT_100, DEFAULT_440)를 제거하고, 이미지가 없을 때 빈 목록을 반환하도록 변경합니다. 테스트 파일들은 이미지 URL 필드 대신 imageKey를 사용하도록 업데이트되었습니다.

Changes

Cohort / File(s) Summary
핵심 서비스 변경
src/main/java/team/wego/wegobackend/group/v2/application/dto/common/GroupImageItem.java, src/main/java/team/wego/wegobackend/group/v2/application/service/GroupV2UpdateService.java
기본 이미지 URL 상수(DEFAULT_100, DEFAULT_440) 제거. defaultLogo() 메서드가 null/0으로 설정된 GroupImageItem을 반환하도록 변경. 이미지 목록이 비어있을 때 기본 로고 항목 주입 제거
V2 그룹 테스트 파일
src/test/http/group/v2/V2-group-cancel.http, src/test/http/group/v2/v2-group-attend.http, src/test/http/group/v2/v2-group-create.http, src/test/http/group/v2/v2-group-get-list.http, src/test/http/group/v2/v2-group-get.http
이미지 업로드 후 저장되는 데이터를 이미지 URL(imageUrl440x240, imageUrl100x100)에서 imageKey로 변경. 그룹 생성 페이로드에서 imageKey 필드 사용으로 업데이트

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • 주의 영역:
    • 서비스 레이어에서 기본 이미지 제거 로직이 예상대로 동작하는지 확인 필요
    • 이미지 없을 때 빈 목록 반환이 클라이언트 기대값과 일치하는지 검증
    • 모든 테스트 파일에서 imageKey 사용 패턴이 일관성 있게 적용되었는지 확인

Possibly Related PRs

Poem

🐰✨ 기본값은 안녕, imageKey로 새로운 시작!
빈 이미지도 괜찮아, []는 정직한 답변,
주소 대신 열쇠를 들고, 더 간결한 길로,
테스트들도 함께 춤을 춘다네. 🎉

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/response

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94c76c4 and e19c948.

📒 Files selected for processing (7)
  • src/main/java/team/wego/wegobackend/group/v2/application/dto/common/GroupImageItem.java
  • src/main/java/team/wego/wegobackend/group/v2/application/service/GroupV2UpdateService.java
  • src/test/http/group/v2/V2-group-cancel.http
  • src/test/http/group/v2/v2-group-attend.http
  • src/test/http/group/v2/v2-group-create.http
  • src/test/http/group/v2/v2-group-get-list.http
  • src/test/http/group/v2/v2-group-get.http

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@LimdaeIl LimdaeIl merged commit ae6e3ff into main Dec 22, 2025
4 of 5 checks passed
@LimdaeIl LimdaeIl deleted the feat/response branch December 22, 2025 01:43
@github-project-automation github-project-automation bot moved this from In progress to Done in WeGo-Together Backend Dec 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 imageKey instead 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장 내려주기
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
// 이미지가 0개면 기본 이미지(variants 2개) 1장 내려주기
// 이미지가 0개면 빈 리스트를 반환 (기본 이미지는 포함하지 않음)

Copilot uses AI. Check for mistakes.
Comment on lines 24 to 32
// 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
);
}
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
"sortOrder": 1,
"imageKey": "{{img1_key}}"
}

Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
"{{img0_key}}",
"{{img1_key}}"

Copilot uses AI. Check for mistakes.
@@ -29,27 +24,10 @@ public static GroupImageItem from(GroupImageV2 image) {
// DB에 이미지가 0개일 때 내려주는 기본 이미지(440/100)
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
// DB에 이미지가 0개일 때 내려주는 기본 이미지(440/100)
// 기본 값이 설정되지 않은 빈 GroupImageItem을 반환합니다.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEAT] Response 필드 구성 일부 리팩토링

1 participant