Skip to content

Commit

Permalink
hotfix: /api/user/healthcheck, /api/admin/user/healthcheck 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
gdtknight committed Aug 10, 2023
1 parent 9c8f729 commit 35dd887
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,30 @@
@RequestMapping("/api/admin/user")
public class UserController {

private final UserService userService;

@GetMapping("/list")
public ResponseEntity<ApiResponse.Result<Object>> list(
@PageableDefault(size = 10) Pageable pageable) {
log.info("GET /api/admin/user/list " + pageable);

Page<UserResponse.ListDTO> listResponse = userService.getAllUsers(pageable);
return ResponseEntity.ok(ApiResponse.success(listResponse));
}

@PostMapping("/signIn")
public ResponseEntity<ApiResponse.Result<Object>> signIn(
@RequestBody @Valid UserRequest.SignInDTO signInDTO,
Errors errors) {
log.info("POST /api/admin/user/signIn" + signInDTO);

UserResponse.SignInDTO signInResponse = userService.signIn(signInDTO);
return ResponseEntity.ok()
.header(JwtTokenProvider.HEADER, signInResponse.getJwt())
.body(ApiResponse.success());}
private final UserService userService;

@RequestMapping("/healthcheck")
public ResponseEntity<ApiResponse.Result<Object>> healthcheck() {
return ResponseEntity.ok(ApiResponse.success());
}

@GetMapping("/list")
public ResponseEntity<ApiResponse.Result<Object>> list(
@PageableDefault(size = 10) Pageable pageable) {
log.info("GET /api/admin/user/list " + pageable);

Page<UserResponse.ListDTO> listResponse = userService.getAllUsers(pageable);
return ResponseEntity.ok(ApiResponse.success(listResponse));
}

@PostMapping("/signIn")
public ResponseEntity<ApiResponse.Result<Object>> signIn(
@RequestBody @Valid UserRequest.SignInDTO signInDTO, Errors errors) {
log.info("POST /api/admin/user/signIn" + signInDTO);

UserResponse.SignInDTO signInResponse = userService.signIn(signInDTO);
return ResponseEntity.ok()
.header(JwtTokenProvider.HEADER, signInResponse.getJwt())
.body(ApiResponse.success());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public class UserController {
private final LoggingService loggingService;
private final MailService mailService;

@RequestMapping("/healthcheck")
public ResponseEntity<ApiResponse.Result<Object>> signup() {

return ResponseEntity.ok(ApiResponse.success());
}

@PostMapping("/signup")
public ResponseEntity<ApiResponse.Result<User>> signup(
@RequestBody @Valid UserRequest.SignUpDTO signUpDTO, Errors errors) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
expressionInterceptUrlRegistry ->
expressionInterceptUrlRegistry
.antMatchers(
"/api/admin/user/healthcheck",
"/api/user/healthcheck",
"/api/admin/user/signIn",
"/api/user/signin",
"/api/user/signup",
Expand Down

0 comments on commit 35dd887

Please sign in to comment.