From 942052ad9801d049942787460fb5f0f445ac332a Mon Sep 17 00:00:00 2001 From: kgy1008 Date: Sun, 12 Jan 2025 23:05:33 +0900 Subject: [PATCH] [refac] delete blank for adhere convention --- .../api/auth/controller/AuthController.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/hankki/hankkiserver/api/auth/controller/AuthController.java b/src/main/java/org/hankki/hankkiserver/api/auth/controller/AuthController.java index e447a5d5..08d55489 100644 --- a/src/main/java/org/hankki/hankkiserver/api/auth/controller/AuthController.java +++ b/src/main/java/org/hankki/hankkiserver/api/auth/controller/AuthController.java @@ -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 @@ -21,24 +27,21 @@ public class AuthController { private final AuthService authService; @PostMapping("/auth/login") - public HankkiResponse login( - @RequestHeader(HttpHeaders.AUTHORIZATION) final String token, - @Valid @RequestBody final UserLoginRequest request) { - final UserLoginResponse response = authService.login(token, request); + public HankkiResponse 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 signOut( - @UserId final Long userId) { + public HankkiResponse signOut(@UserId final Long userId) { authService.logout(userId); return HankkiResponse.success(CommonSuccessCode.OK); } @DeleteMapping("/auth/withdraw") - public HankkiResponse withdraw( - @UserId final Long userId, - @Nullable @RequestHeader("X-Apple-Code") final String code){ + public HankkiResponse withdraw(@UserId final Long userId, + @Nullable @RequestHeader("X-Apple-Code") final String code) { authService.withdraw(userId, code); return HankkiResponse.success(CommonSuccessCode.NO_CONTENT); } @@ -46,7 +49,7 @@ public HankkiResponse withdraw( @PostMapping("/auth/reissue") public HankkiResponse reissue( @RequestHeader(HttpHeaders.AUTHORIZATION) final String refreshToken) { - final UserReissueResponse response = authService.reissue(refreshToken); + UserReissueResponse response = authService.reissue(refreshToken); return HankkiResponse.success(CommonSuccessCode.OK, response); } }