Skip to content

Commit

Permalink
feat: 사용 중인 전화번호 검증 API 추가(#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
Minjae-An committed May 8, 2024
1 parent 7ba5bcd commit ff5600c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions be/src/main/java/yeonba/be/login/controller/LoginController.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
import yeonba.be.login.dto.request.UserLoginRequest;
import yeonba.be.login.dto.request.UserRefreshJwtRequest;
import yeonba.be.login.dto.request.UserValidateUsedNicknameRequest;
import yeonba.be.login.dto.request.UserValidateUsedPhoneNumberRequest;
import yeonba.be.login.dto.response.UserJoinResponse;
import yeonba.be.login.dto.response.UserLoginResponse;
import yeonba.be.login.dto.response.UserRefrehJwtResponse;
import yeonba.be.login.dto.response.UserValidateUsedNicknameResponse;
import yeonba.be.login.dto.response.UserValidateUsedPhoneNumberResponse;
import yeonba.be.login.service.LoginService;
import yeonba.be.user.service.JoinService;
import yeonba.be.util.CustomResponse;
Expand Down Expand Up @@ -71,8 +73,8 @@ public ResponseEntity<CustomResponse<UserRefrehJwtResponse>> refreshJwt(
.body(new CustomResponse<>(response));
}

@Operation(summary = "사용 중인 닉네임 확인", description = "사용 중인 닉네임인 지 검증할 수 있습니다.")
@ApiResponse(responseCode = "200", description = "닉네임 중복 검증 성공")
@Operation(summary = "사용 중인 닉네임 검증", description = "사용 중인 닉네임인 지 검증할 수 있습니다.")
@ApiResponse(responseCode = "200", description = "사용 중인 닉네임 검증 성공")
@GetMapping("/users/nicknames/used")
public ResponseEntity<CustomResponse<UserValidateUsedNicknameResponse>> validateUsedNickname(
@Valid @ParameterObject UserValidateUsedNicknameRequest request) {
Expand All @@ -84,4 +86,18 @@ public ResponseEntity<CustomResponse<UserValidateUsedNicknameResponse>> validate
.ok()
.body(new CustomResponse<>(response));
}

@Operation(summary = "사용 중인 전화번호 검증", description = "사용 중인 전화번호 검증 가능")
@ApiResponse(responseCode = "200", description = "사용 중인 전화번호 검증 성공")
@GetMapping("/users/phone-numbers/used")
public ResponseEntity<CustomResponse<UserValidateUsedPhoneNumberResponse>>
validateUsedPhoneNumber(@Valid @ParameterObject UserValidateUsedPhoneNumberRequest request) {

UserValidateUsedPhoneNumberResponse response =
loginService.validateUsedPhoneNumber(request);

return ResponseEntity
.ok()
.body(new CustomResponse<>(response));
}
}

0 comments on commit ff5600c

Please sign in to comment.