Skip to content

Conversation

Copy link

Copilot AI commented Aug 11, 2025

Implements nickname functionality for users with automatic fallback to the user's name when nickname is not set.

Changes Made

Database Schema

  • Added nullable nickname column to the users table (max 50 characters)
  • Maintains backward compatibility - existing users will have null nickname

API Endpoint

Added PATCH /api/v1/users/nickname endpoint:

// Request
{
  "nickname": "새로운닉네임"
}

// Response
{
  "message": "닉네임이 성공적으로 수정되었습니다.",
  "nickname": "새로운닉네임"
}

Core Logic

  • User Entity: Added nickname field with updateNickname() and getDisplayName() methods
  • Fallback Behavior: getDisplayName() returns nickname if available, otherwise returns name
  • UserInfo DTO: Updated to use display name logic automatically
  • Service Layer: Added UserService with transactional nickname update support

Validation

  • Nickname is optional and limited to 50 characters
  • Empty/whitespace-only nicknames fall back to name
  • Input validation with proper error messages

Example Usage

// User with nickname
User user = User.builder()
    .name("김철수")
    .nickname("철수킹")
    .build();
    
user.getDisplayName(); // Returns "철수킹"

// User without nickname
User user2 = User.builder()
    .name("김영희")
    .nickname(null)
    .build();
    
user2.getDisplayName(); // Returns "김영희"

The implementation follows existing code patterns and includes comprehensive test coverage (16/16 tests passing).

Fixes #61.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Aug 11, 2025
Copy link
Author

Copilot AI commented Aug 11, 2025

@jaejoong0529 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

@shinheekim shinheekim closed this Aug 11, 2025
Copilot AI changed the title [WIP] [FEAT] 닉네임 추가 및 수정 [FEAT] Add nickname feature with fallback to name Aug 11, 2025
Copilot AI requested a review from jaejoong0529 August 11, 2025 16:07
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.

[FEAT] 닉네임 추가 및 수정

3 participants