Skip to content

Feat/member info#149

Merged
sotogito merged 3 commits intodevfrom
feat/member-info
Jan 15, 2026
Merged

Feat/member info#149
sotogito merged 3 commits intodevfrom
feat/member-info

Conversation

@sotogito
Copy link
Collaborator

✅ PR 타입

  • feat: 사용자 이름 반환 api 추가

🪾 반영 브랜치

feat/member-info -> dev

✨ 변경 사항

사용자 이름 반환 api 추가

💯 테스트 결과

 kimsuyeon  ~/Documents/beforegoing-server   feat/member-info ±  ./gradlew clean check test  
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2026-01-14T13:17:23.839+09:00  INFO 10477 --- [server] [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
Hibernate: drop table if exists location_notification cascade 
Hibernate: drop table if exists member cascade 
Hibernate: drop table if exists mission cascade 
Hibernate: drop table if exists notification cascade 
Hibernate: drop table if exists scenario cascade 
Hibernate: drop table if exists terms cascade 
Hibernate: drop table if exists time_notification cascade 

[Incubating] Problems report is available at: file:///Users/kimsuyeon/Documents/beforegoing-server/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 22s
10 actionable tasks: 10 executed

📂 관련 이슈

👀 리뷰어에게

@sotogito sotogito requested a review from choridev January 14, 2026 04:23
@gemini-code-assist
Copy link

Summary of Changes

Hello @sotogito, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 사용자가 자신의 닉네임을 조회할 수 있는 새로운 기능을 백엔드에 추가합니다. 이는 기존 회원 관리 기능에 닉네임 조회 API를 통합하여 사용자 경험을 개선하고, 관련 테스트 케이스를 통해 기능의 안정성을 보장합니다.

Highlights

  • 새로운 API 엔드포인트 추가: 인증된 사용자의 닉네임을 반환하는 /v1/member/nickname GET 엔드포인트를 MemberController에 추가했습니다.
  • 닉네임 조회 기능 구현: MemberService를 통해 memberId로 회원을 찾아 닉네임을 반환하는 로직을 구현했습니다.
  • 테스트 코드 강화: 새로 추가된 닉네임 조회 API에 대한 단위 테스트를 MemberControllerTest에 추가하여, 인증되지 않은 사용자의 접근 처리와 인증된 사용자의 성공적인 닉네임 조회 시나리오를 검증합니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 사용자의 닉네임을 반환하는 API를 추가하는 변경사항을 담고 있습니다. 전반적으로 기능 구현은 잘 되었으나, API 응답 형식의 일관성을 개선할 부분이 보입니다. 컨트롤러에서 원시 문자열 대신 JSON 객체를 반환하도록 수정하고, 이에 맞춰 테스트 코드도 함께 업데이트하는 것을 제안합니다. 자세한 내용은 각 파일에 남긴 리뷰 코멘트를 참고해주세요.

Comment on lines +31 to +37
public ResponseEntity<String> getNickname(
@Parameter(hidden = true) @AuthMember final Long memberId
) {
final Member member = memberService.findMemberById(memberId);

return ResponseEntity.status(HttpStatus.OK).body(member.getNickname());
}

Choose a reason for hiding this comment

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

medium

API 응답의 일관성과 확장성을 위해 원시 문자열(raw string) 대신 JSON 객체를 반환하는 것이 좋습니다. 다른 API(updateNickname 등)들이 JSON을 반환하는 것과 맞추면 클라이언트 측에서 더 일관되게 처리할 수 있습니다.

java.util.Map을 사용하여 간단한 JSON 객체를 생성할 수 있습니다. 아래 제안처럼 FQCN(정규화된 클래스 이름)을 사용하면 별도의 import문 추가 없이 바로 적용 가능하며, 추후 import문을 추가하고 타입을 간소화할 수 있습니다.

또한 ResponseEntity.status(HttpStatus.OK).body(...) 대신 ResponseEntity.ok(...)을 사용하면 코드를 더 간결하게 만들 수 있습니다.

Suggested change
public ResponseEntity<String> getNickname(
@Parameter(hidden = true) @AuthMember final Long memberId
) {
final Member member = memberService.findMemberById(memberId);
return ResponseEntity.status(HttpStatus.OK).body(member.getNickname());
}
public ResponseEntity<java.util.Map<String, String>> getNickname(
@Parameter(hidden = true) @AuthMember final Long memberId
) {
final Member member = memberService.findMemberById(memberId);
return ResponseEntity.ok(java.util.Map.of("nickname", member.getNickname()));
}

Comment on lines +182 to +187
final String responseContent = resultActions
.andExpect(status().isOk())
.andReturn()
.getResponse()
.getContentAsString(StandardCharsets.UTF_8);
assertThat(responseContent).isEqualTo(nickname);

Choose a reason for hiding this comment

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

medium

컨트롤러가 JSON 객체를 반환하도록 수정하는 제안에 맞춰, 테스트 코드도 JSON 응답을 검증하도록 수정해야 합니다. jsonPath를 사용하면 응답 본문의 특정 필드 값을 간결하게 확인할 수 있습니다.

		resultActions
			.andExpect(status().isOk())
			.andExpect(jsonPath("$.nickname").value(nickname));

@sonarqubecloud
Copy link

@sotogito sotogito merged commit b286bf2 into dev Jan 15, 2026
5 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.

2 participants

Comments