Skip to content

Commit

Permalink
[refac] delete blank for adhere convention
Browse files Browse the repository at this point in the history
  • Loading branch information
kgy1008 committed Jan 12, 2025
1 parent 8816627 commit 942052a
Showing 1 changed file with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
import jakarta.annotation.Nullable;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.hankki.hankkiserver.api.common.annotation.UserId;
import org.hankki.hankkiserver.api.dto.HankkiResponse;
import org.hankki.hankkiserver.common.code.CommonSuccessCode;
import org.hankki.hankkiserver.api.auth.service.AuthService;
import org.hankki.hankkiserver.api.auth.controller.request.UserLoginRequest;
import org.hankki.hankkiserver.api.auth.service.AuthService;
import org.hankki.hankkiserver.api.auth.service.response.UserLoginResponse;
import org.hankki.hankkiserver.api.auth.service.response.UserReissueResponse;
import org.hankki.hankkiserver.api.common.annotation.UserId;
import org.hankki.hankkiserver.api.dto.HankkiResponse;
import org.hankki.hankkiserver.common.code.CommonSuccessCode;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
Expand All @@ -21,32 +27,29 @@ public class AuthController {
private final AuthService authService;

@PostMapping("/auth/login")
public HankkiResponse<UserLoginResponse> login(
@RequestHeader(HttpHeaders.AUTHORIZATION) final String token,
@Valid @RequestBody final UserLoginRequest request) {
final UserLoginResponse response = authService.login(token, request);
public HankkiResponse<UserLoginResponse> login(@RequestHeader(HttpHeaders.AUTHORIZATION) final String token,
@Valid @RequestBody final UserLoginRequest request) {
UserLoginResponse response = authService.login(token, request);
return HankkiResponse.success(CommonSuccessCode.OK, response);
}

@PatchMapping("/auth/logout")
public HankkiResponse<Void> signOut(
@UserId final Long userId) {
public HankkiResponse<Void> signOut(@UserId final Long userId) {
authService.logout(userId);
return HankkiResponse.success(CommonSuccessCode.OK);
}

@DeleteMapping("/auth/withdraw")
public HankkiResponse<Void> withdraw(
@UserId final Long userId,
@Nullable @RequestHeader("X-Apple-Code") final String code){
public HankkiResponse<Void> withdraw(@UserId final Long userId,
@Nullable @RequestHeader("X-Apple-Code") final String code) {
authService.withdraw(userId, code);
return HankkiResponse.success(CommonSuccessCode.NO_CONTENT);
}

@PostMapping("/auth/reissue")
public HankkiResponse<UserReissueResponse> reissue(
@RequestHeader(HttpHeaders.AUTHORIZATION) final String refreshToken) {
final UserReissueResponse response = authService.reissue(refreshToken);
UserReissueResponse response = authService.reissue(refreshToken);
return HankkiResponse.success(CommonSuccessCode.OK, response);
}
}

0 comments on commit 942052a

Please sign in to comment.