Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,12 @@ public ResponseEntity<Map<String, Boolean>> checkEmail(@RequestParam String emai
boolean isDuplicate = userService.isEmailDuplicate(email);
return ResponseEntity.ok(Map.of("isDuplicate", isDuplicate));
}
}

// 유저 아이디 중복 검사
@GetMapping("/check-user-id")
@Operation(summary = "유저 아이디 중복 검사")
public ResponseEntity<Map<String, Boolean>> checkUserId(@RequestParam String nameId) {
boolean isDuplicate = userService.isnameIdDuplicate(nameId);
return ResponseEntity.ok(Map.of("isDuplicate", isDuplicate));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public interface UserService {
UserResponseDTO.ProfileDto getMyIcon();
UserResponseDTO.UserBlockResponseDto blockUser(Long targetUserId);
boolean isEmailDuplicate(String email);
boolean isnameIdDuplicate(String nameId);

// UserQueryService
UserInfoDTO getUserInfo(HttpServletRequest request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,9 @@ public UserResponseDTO.UserBlockResponseDto blockUser(Long targetUserId) {
public boolean isEmailDuplicate(String email){
return userRepository.existsByEmail(email);
}

// 유저 아이디 중복 검사
public boolean isnameIdDuplicate(String nameId){
return userRepository.existsByNameId(nameId);
}
}
Loading