-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename: auth controller '일반 회원 가입' 전화번호 인증 swagger 문서 상 명시 * feat: 닉네임 중복 검사 domain service 메서드 추가 * feat: username 중복 검사 api 개방 * fix: 중복 검사 체크 url을 anonymous endpoints에 추가 * fix: swagger endpoints와 read only public endpoints 분리 * fix: 닉네임 중복 검사 인가 기준 permit-all로 변경 * rename: is-exist-nickname -> is-exist-username * rename: auth check controller 매개변수명 username으로 수정
- Loading branch information
1 parent
f925160
commit b6943e4
Showing
6 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...ternal-api/src/main/java/kr/co/pennyway/api/apis/auth/controller/AuthCheckController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package kr.co.pennyway.api.apis.auth.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import kr.co.pennyway.api.apis.auth.usecase.AuthCheckUseCase; | ||
import kr.co.pennyway.api.common.response.SuccessResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Slf4j | ||
@Tag(name = "[계정 검사 API]") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/v1/duplicate") | ||
public class AuthCheckController { | ||
private final AuthCheckUseCase authCheckUseCase; | ||
|
||
@Operation(summary = "닉네임 중복 검사") | ||
@GetMapping("/username") | ||
@PreAuthorize("permitAll()") | ||
public ResponseEntity<?> checkUsername(@RequestParam @Validated String username) { | ||
return ResponseEntity.ok(SuccessResponse.from("isDuplicate", authCheckUseCase.checkUsernameDuplicate(username))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...app-external-api/src/main/java/kr/co/pennyway/api/apis/auth/usecase/AuthCheckUseCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package kr.co.pennyway.api.apis.auth.usecase; | ||
|
||
import kr.co.pennyway.common.annotation.UseCase; | ||
import kr.co.pennyway.domain.domains.user.service.UserService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Slf4j | ||
@UseCase | ||
@RequiredArgsConstructor | ||
public class AuthCheckUseCase { | ||
private final UserService userService; | ||
|
||
@Transactional(readOnly = true) | ||
public boolean checkUsernameDuplicate(String username) { | ||
return userService.isExistUsername(username); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters