Skip to content

[FEAT] 유저 정보 조회 응답 형식 통일#257

Merged
yooooonshine merged 3 commits intodevelopfrom
feature/256-refactor-user-info-api
Nov 16, 2025
Merged

[FEAT] 유저 정보 조회 응답 형식 통일#257
yooooonshine merged 3 commits intodevelopfrom
feature/256-refactor-user-info-api

Conversation

@yooooonshine
Copy link
Contributor

@yooooonshine yooooonshine commented Nov 16, 2025

개요

작업사항

  • 내 정보 조회 API 응답 형식 통일
  • 유저 검색 API 응답 형식 통일

Summary by CodeRabbit

릴리스 노트

  • API 변경 사항
    • 사용자 검색 및 조회 API의 응답 필드명이 명확하게 변경되었습니다.
    • 사용자 ID 필드: iduserId
    • 사용자명 필드: nameuserName

@yooooonshine yooooonshine linked an issue Nov 16, 2025 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Nov 16, 2025

워크스루

사용자 정보 응답 DTO의 필드명을 표준화하는 리팩토링입니다. SearchUsersResponseUserInfoResponse 레코드에서 iduserId로, nameuserName으로 변경하고, 이에 맞춰 테스트 코드의 단언문과 JSON 경로를 업데이트했습니다.

변경사항

응집 / 파일 변경 요약
DTO 필드명 통합
src/main/java/hanium/modic/backend/web/user/dto/response/SearchUsersResponse.java, src/main/java/hanium/modic/backend/web/user/dto/response/UserInfoResponse.java
레코드 컴포넌트명을 표준화: iduserId, nameuserName (SearchUsersResponse에만 해당). 접근자 메서드 이름도 자동으로 변경됨.
테스트 코드 업데이트
src/test/java/hanium/modic/backend/domain/user/service/UserServiceTest.java, src/test/java/hanium/modic/backend/web/user/controller/UserControllerIntegrationTest.java, src/test/java/hanium/modic/backend/web/user/controller/UserControllerTest.java
단언문 및 JSON 경로를 업데이트: id()userId(), $.data.id$.data.userId로 변경하여 DTO 필드명 변경과 동기화.

예상 코드 리뷰 난이도

🎯 2 (심플) | ⏱️ ~10분

  • 주의 깊게 확인할 사항:
    • 레코드 컴포넌트 변경이 다른 곳에서도 사용되는지 확인 필요 (DTO 직렬화/역직렬화 로직)
    • JSON 매핑 도구(예: Jackson, Lombok)의 명시적 설정 여부 검토
    • 테스트 커버리지가 모든 영향받는 API 엔드포인트를 다루고 있는지 확인

관련 가능성 있는 PR

🐰 필드명을 정렬하고
API 형식을 하나로,
유지보수의 봄이 오네요—
userId로 통일되어
코드의 정원이 피어납니다! 🌷

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 풀 리퀘스트의 주요 변경사항인 유저 정보 조회 응답 형식 통일을 명확하게 설명하고 있습니다.
Description check ✅ Passed 설명이 템플릿의 필수 섹션(개요, 작업사항)을 모두 포함하고 있으며 linked issue와 작업사항이 명확히 기술되어 있습니다.
Linked Issues check ✅ Passed SearchUsersResponse와 UserInfoResponse의 필드명을 id/name에서 userId/userName으로 통일하여 응답 형식 일관성을 개선했습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항은 유저 정보 조회 응답 형식 통일이라는 목표와 직접적으로 관련되어 있으며 범위 내에 있습니다.
✨ 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 feature/256-refactor-user-info-api

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44ed0ca and 313381a.

📒 Files selected for processing (5)
  • src/main/java/hanium/modic/backend/web/user/dto/response/SearchUsersResponse.java (1 hunks)
  • src/main/java/hanium/modic/backend/web/user/dto/response/UserInfoResponse.java (1 hunks)
  • src/test/java/hanium/modic/backend/domain/user/service/UserServiceTest.java (1 hunks)
  • src/test/java/hanium/modic/backend/web/user/controller/UserControllerIntegrationTest.java (1 hunks)
  • src/test/java/hanium/modic/backend/web/user/controller/UserControllerTest.java (1 hunks)
🔇 Additional comments (5)
src/test/java/hanium/modic/backend/web/user/controller/UserControllerIntegrationTest.java (1)

91-93: LGTM! 테스트가 DTO 변경사항을 올바르게 반영합니다.

JSON 경로가 $.data.id에서 $.data.userId로 올바르게 업데이트되어 UserInfoResponse의 필드명 변경과 일치합니다.

src/test/java/hanium/modic/backend/web/user/controller/UserControllerTest.java (1)

152-153: LGTM! 컨트롤러 테스트가 API 응답 형식 변경을 올바르게 반영합니다.

JSON 경로가 userId로 업데이트되어 통일된 응답 형식과 일치합니다.

src/test/java/hanium/modic/backend/domain/user/service/UserServiceTest.java (1)

134-136: LGTM! 서비스 테스트가 새로운 접근자 메서드를 올바르게 사용합니다.

UserInfoResponse 레코드의 컴포넌트명 변경에 맞춰 id()에서 userId()로 올바르게 업데이트되었습니다.

src/main/java/hanium/modic/backend/web/user/dto/response/SearchUsersResponse.java (1)

5-10: 필드명 변경이 안전하게 적용되었습니다.

검증 결과, 이전 필드명(id, name)을 참조하는 코드가 없으므로 Breaking Change가 올바르게 처리되었습니다. userIduserName으로의 전환이 완료되었고, UserInfoResponse와의 일관된 네이밍도 확인되었습니다.

src/main/java/hanium/modic/backend/web/user/dto/response/UserInfoResponse.java (1)

10-16: 검증 완료 - 변경 사항이 올바르게 적용되었습니다.

검증 결과 다음 사항을 확인했습니다:

  • UserInfoResponse 레코드의 필드가 userId로 올바르게 변경됨
  • 팩토리 메서드 UserInfoResponse.of()이 정확하게 동작
  • UserServiceTest.java:134에서 새로운 접근자 response.userId()가 정상 사용 중
  • 컨트롤러와 서비스 모두 업데이트된 필드명으로 올바르게 동작
  • 이전 필드명 id에 대한 참조가 없음
  • @JsonProperty 어노테이션으로 JSON 매핑 오버라이드되지 않음

모든 변경 사항이 일관되게 적용되었으며, API 소비자에게 미치는 Breaking Change 경고는 중요하고 정확합니다.


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.

@yooooonshine yooooonshine merged commit 34cf1f1 into develop Nov 16, 2025
2 checks passed
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.

유저정보 조회 api 컴포넌트 통합

1 participant