Skip to content

Comments

[FEAT] 공통 응답 수정#35

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

[FEAT] 공통 응답 수정#35
LimdaeIl merged 2 commits intomainfrom
feat/response

Conversation

@LimdaeIl
Copy link
Collaborator

@LimdaeIl LimdaeIl commented Dec 8, 2025

📝 Pull Request

📌 PR 종류

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

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

✨ 변경 내용

  • 공통 응답 필드에서 HTTP Status인 String code를 제거합니다.

🔍 관련 이슈

🧪 테스트

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

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

🚨 확인해야 할 사항 (Checklist)

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

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

🙋 기타 참고 사항

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

Summary by CodeRabbit

  • 리팩토링
    • API 응답 구조가 단순화되었습니다. 응답은 이제 메시지와 데이터 필드만 포함합니다.

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

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

coderabbitai bot commented Dec 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

ApiResponse 레코드에서 code 필드를 제거하여 String messageT data로 시그니처를 변경했습니다. 이에 따라 static factory 메서드들을 수정하고, ImageController의 여러 엔드포인트에서 ApiResponse 생성 시 상태 값 인자를 제거했습니다.

Changes

Cohort / File(s) Summary
ApiResponse 레코드 시그니처 및 팩토리 메서드 수정
src/main/java/team/wego/wegobackend/common/response/ApiResponse.java
레코드 필드에서 code 제거 ((String code, String message, T data)(String message, T data)), success(T data), success(String message, T data), success(String message), error(String message), error(String message, T data) 팩토리 메서드 업데이트
ImageController API 응답 호출 업데이트
src/main/java/team/wego/wegobackend/image/presentation/ImageController.java
7개 메서드(uploadOriginal, uploadOriginals, uploadAsWebp, uploadAllAsWebp, deleteOne, deleteMany, uploadThumb)에서 ApiResponse.success(...) 호출 시 상태 값 인자 제거

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10-15 minutes

  • ApiResponse.java의 메서드 오버로드 제거 및 새 시그니처 일관성 확인
  • ImageController의 7개 메서드에서 ApiResponse 호출 수정이 모두 동일한 패턴인지 검증

Possibly related PRs

Poem

🐰 코드를 빼니 깔끔하네,
메시지만 남아 정갈하고,
컨트롤러마다 손질하며,
응답은 더 단순해지고,
우리 API도 한결 가벼워졌네! ✨

✨ 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 3f3b72b and 8524ef6.

📒 Files selected for processing (2)
  • src/main/java/team/wego/wegobackend/common/response/ApiResponse.java (1 hunks)
  • src/main/java/team/wego/wegobackend/image/presentation/ImageController.java (0 hunks)

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

@LimdaeIl LimdaeIl merged commit 555652a into main Dec 8, 2025
4 of 5 checks passed
@LimdaeIl LimdaeIl deleted the feat/response branch December 8, 2025 07:25
@github-project-automation github-project-automation bot moved this from In progress to Done in WeGo-Together Backend Dec 8, 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 removes the HTTP status code field from the common API response structure, simplifying the response format to only include a message and optional data field.

Key Changes:

  • Removed the code field from the ApiResponse record
  • Simplified all factory methods (success and error) to accept only message and data parameters
  • Updated all ImageController endpoints to use the new method signatures

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
ApiResponse.java Removed code field from record definition and simplified all factory methods to no longer accept or use HTTP status codes
ImageController.java Updated all seven endpoint response calls to remove the status code parameter from ApiResponse.success() calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public static <T> ApiResponse<T> success(String code, String message) {
return new ApiResponse<>(code, message, null);
public static <T> ApiResponse<T> success( String message) {
return new ApiResponse<>( message, null);
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Extra space after the opening parenthesis. Should be return new ApiResponse<>(message, null); without the extra space.

Suggested change
return new ApiResponse<>( message, null);
return new ApiResponse<>(message, null);

Copilot uses AI. Check for mistakes.

public static <T> ApiResponse<T> success(int code, String message, T data) {
return new ApiResponse<>(String.valueOf(code), message, data);
public static <T> ApiResponse<T> error( String message) {
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Extra space after the opening parenthesis and before the parameter. Should be public static <T> ApiResponse<T> error(String message) without the extra space before String.

Copilot uses AI. Check for mistakes.

public static <T> ApiResponse<T> success(T data) {
return new ApiResponse<>("200", "요청이 정상적으로 처리되었습니다.", data);
return new ApiResponse<>( "요청이 정상적으로 처리되었습니다.", data);
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Extra space after the opening parenthesis. Should be return new ApiResponse<>("요청이 정상적으로 처리되었습니다.", data); without the extra space.

Suggested change
return new ApiResponse<>( "요청이 정상적으로 처리되었습니다.", data);
return new ApiResponse<>("요청이 정상적으로 처리되었습니다.", data);

Copilot uses AI. Check for mistakes.

public static <T> ApiResponse<T> success(String code, String message) {
return new ApiResponse<>(code, message, null);
public static <T> ApiResponse<T> success( String message) {
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Extra space after the opening parenthesis and before the parameter. Should be public static <T> ApiResponse<T> success(String message) without the extra space before String.

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] 공통 응답 수정

1 participant