Skip to content

Conversation

@minjee2758
Copy link
Collaborator

@minjee2758 minjee2758 commented Aug 28, 2025

PR 생성 시 아래 항목을 채워주세요.

제목 예시: feat : Pull request template 작성

(작성 후 이 안내 문구는 삭제해주세요)


작업 내용

  • 어떤 기능(또는 수정 사항)을 구현했는지 간략하게 설명해주세요.
  • 예) "회원가입 API에 이메일 중복 검사 기능 추가"

변경 사항

  • 구현한 주요 로직, 클래스, 메서드 등을 bullet 형식으로 기술해주세요.
  • 예)
    • UserService.createUser() 메서드 추가
    • @Email 유효성 검증 적용

트러블 슈팅

  • 구현 중 마주한 문제와 해결 방법을 기술해주세요.
  • 예)
    • 문제: @Transactional이 적용되지 않음
    • 해결: 메서드 호출 방식 변경 (this.AopProxyUtils. 사용)

해결해야 할 문제

  • 기능은 동작하지만 리팩토링이나 논의가 필요한 부분을 적어주세요.
  • 예)D
    • UserController에서 비즈니스 로직 일부 처리 → 서비스로 이전 고려 필요

참고 사항

  • 기타 공유하고 싶은 정보나 참고한 문서(링크 등)가 있다면 작성해주세요.

코드 리뷰 전 확인 체크리스트

  • 불필요한 콘솔 로그, 주석 제거
  • 커밋 메시지 컨벤션 준수 (type : )
  • 기능 정상 동작 확인

Summary by CodeRabbit

  • 신규 기능
    • 사용자 정보 조회 응답에서 언어가 단일 값이 아닌 “언어 정보” 객체로 제공됩니다.
  • 리팩터링
    • 내부 응답 DTO 사용으로 사용자 정보 응답의 언어 표현이 일관화되었습니다.
  • 문서
    • API 문서(스웨거)에서 언어 필드를 “언어 정보” 객체로 설명하도록 갱신했습니다.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

UserInfoResponse의 language 타입을 Language에서 LanguageResponse로 교체했습니다. UserService는 user.getLanguage()LanguageResponse.from(...)으로 변환해 설정하도록 수정했습니다. UserController는 인덴트(포맷팅) 변경만 있었으며 경로·시그니처는 동일합니다.

Changes

Cohort / File(s) Summary
DTO 응답 교체 (Language → LanguageResponse)
src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserInfoResponse.java
language 필드 및 생성자 파라미터 타입을 LanguageLanguageResponse로 변경. Swagger @Schema 설명을 객체 정보로 업데이트. 빌더의 language(...) 파라미터 타입도 LanguageResponse로 변경.
서비스 계층 매핑 수정
src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java
getUserInfo, modifyUserInfo에서 user.getLanguage() 대신 LanguageResponse.from(user.getLanguage())를 사용하도록 변경. 관련 import 추가.
컨트롤러 포맷팅 변경
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java
modifyUserInfo 어노테이션 인덴트(포맷팅)만 조정됨. 경로와 메서드 시그니처, 동작은 변경 없음.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant C as UserController
  participant S as UserService
  participant D as UserRepository
  participant M as LanguageResponse

  rect rgba(200,235,255,0.25)
    U->>C: GET /users/info
    C->>S: getUserInfo()
    S->>D: findById(...)
    D-->>S: User(entity)
    note over S,M: 도메인 Language → DTO 변환
    S->>M: LanguageResponse.from(user.language)
    M-->>S: LanguageResponse
    S-->>C: UserInfoResponse(language=LanguageResponse, ...)
    C-->>U: 200 OK (JSON)
  end
Loading
sequenceDiagram
  autonumber
  actor U as User
  participant C as UserController
  participant S as UserService
  participant D as UserRepository
  participant M as LanguageResponse

  rect rgba(220,255,220,0.25)
    U->>C: PUT /users
    C->>S: modifyUserInfo(request)
    S->>D: save/update User
    D-->>S: User(entity)
    note over S,M: 도메인 Language → DTO 변환
    S->>M: LanguageResponse.from(user.language)
    M-->>S: LanguageResponse
    S-->>C: UserInfoResponse(language=LanguageResponse, ...)
    C-->>U: 200 OK (JSON)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Feature/user language select #180: UserInfoResponse 및 사용자 언어 처리 변경과 직접적 연관 — 본 PR과 DTO/도메인 언어 매핑 상호작용 가능성이 높음.

Suggested reviewers

  • thezz9
  • pokerbearkr

Poem

폴짝, 폴짝 코드밭을 뛰네,
언어는 새 옷 LanguageResponse로 갈아입고,
서비스는 살며시 매핑을 건네주네 🥕
컨트롤러는 조용히 포맷만 손봤고,
토끼는 빙긋, 배포는 한숨 고르네 ✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8f90731 and 543efd2.

📒 Files selected for processing (1)
  • src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/user-language

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java (1)

103-106: 신규 프로필 업로드 후 ‘새 이미지’를 삭제하는 역삭제 버그.

oldImageUrl을 삭제해야 하는데, 변경 후의 user.getProfileImageUrl()을 삭제하고 있습니다.

적용 diff:

-            user.modifyProfileImage(profileImageUrl);
-            if (oldImageUrl!=null) {
-                s3Uploader.delete(user.getProfileImageUrl(), "profile");
-            }
+            user.modifyProfileImage(profileImageUrl);
+            if (oldImageUrl != null) {
+                s3Uploader.delete(oldImageUrl, "profile");
+            }
🧹 Nitpick comments (3)
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (1)

48-56: consumes 변경에 따른 호환성 점검 필요.

이 변경으로 해당 엔드포인트는 multipart/form-data만 수용합니다. 기존에 application/json으로만 요청하던 클라이언트가 있다면 415가 발생할 수 있습니다. 영향 범위 확인 부탁드립니다. 필요 시 JSON 전용 오버로드를 추가하는 방안을 고려하세요.

예시:

 @PutMapping(path = "/users", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
 public ResponseEntity<UserInfoResponse> modifyUserInfo(...)

+@PutMapping(path = "/users", consumes = MediaType.APPLICATION_JSON_VALUE)
+public ResponseEntity<UserInfoResponse> modifyUserInfoJson(
+    @AuthenticationPrincipal AuthUser authUser,
+    @Valid @RequestBody ModifyUserInfoRequest request
+){
+    return ResponseEntity.status(HttpStatus.OK).body(userService.modifyUserInfo(authUser, request, null));
+}
src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java (2)

81-83: null-safe 매핑 보강 제안.

user.getLanguage()가 null일 수 있다면 NPE 위험이 있습니다. from(...)에서 null을 허용하지 않는다면 방어 로직을 추가하세요.

적용 diff:

-            .language(LanguageResponse.from(user.getLanguage()))
+            .language(user.getLanguage() != null ? LanguageResponse.from(user.getLanguage()) : null)

두 위치 동일 적용.

Also applies to: 121-123


89-89: 오타: 변수명 findLangauge → findLanguage.

가독성과 일관성을 위해 수정 권장.

적용 diff:

-        Language findLangauge = languageDomainService.getLanguage(request.languageId());
+        Language findLanguage = languageDomainService.getLanguage(request.languageId());
 ...
-            findLangauge);
+            findLanguage);

Also applies to: 97-97

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d570c24 and 8f90731.

📒 Files selected for processing (3)
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserInfoResponse.java (3 hunks)
  • src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java (3 hunks)
  • src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserController.java

[error] 49-49: cannot find symbol: variable MediaType in @PutMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE); ensure org.springframework.http.MediaType is imported.

🔇 Additional comments (3)
src/main/java/org/ezcode/codetest/application/usermanagement/user/service/UserService.java (1)

13-13: LanguageResponse import 추가 적절.

응답 계층 의존으로 정리된 방향성 좋습니다.

src/main/java/org/ezcode/codetest/application/usermanagement/user/dto/response/UserInfoResponse.java (2)

5-5: LanguageResponse로의 의존 전환 적절.

DTO에서 도메인 엔티티 분리를 명확히 했습니다.


54-56: 공용 API 스키마 변경에 따른 소비자 영향 점검.

language 필드 타입 변경은 응답 스키마를 바꿉니다. 프론트/외부 소비자 호환성 및 문서 업데이트 확인 바랍니다.

Also applies to: 63-65

@minjee2758 minjee2758 merged commit f6679f8 into dev Aug 28, 2025
2 checks passed
@minjee2758 minjee2758 deleted the refactor/user-language branch August 28, 2025 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants