-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from Mojacknong/feature_29/코드-정리
Feature 29/코드 정리
- Loading branch information
Showing
21 changed files
with
218 additions
and
210 deletions.
There are no files selected for viewing
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
26 changes: 7 additions & 19 deletions
26
src/main/java/modernfarmer/server/farmususer/user/controller/AuthController.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 |
---|---|---|
@@ -1,52 +1,40 @@ | ||
package modernfarmer.server.farmususer.user.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import modernfarmer.server.farmususer.user.dto.response.BaseResponseDto; | ||
import modernfarmer.server.farmususer.user.dto.response.TokenResponseDto; | ||
import modernfarmer.server.farmususer.user.service.AuthService; | ||
import modernfarmer.server.farmususer.user.util.JwtTokenProvider; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.*; | ||
import javax.servlet.http.HttpServletRequest; | ||
|
||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@RestController | ||
@RequestMapping("/api/user/auth") | ||
public class AuthController { | ||
private final Logger LOGGER = LoggerFactory.getLogger(AuthController.class); | ||
|
||
private final AuthService authService; | ||
private final JwtTokenProvider jwtTokenProvider; | ||
|
||
@PostMapping(value = "/kakao-login") | ||
public BaseResponseDto kakaoLogin(HttpServletRequest request) { | ||
public BaseResponseDto<TokenResponseDto> kakaoLogin(HttpServletRequest request) { | ||
|
||
String accessToken = jwtTokenProvider.resolveToken(request); | ||
|
||
BaseResponseDto reissueTokenResponseDto = authService.kakaoLogin(accessToken); | ||
|
||
LOGGER.info("카카오 로그인 완료"); | ||
|
||
return reissueTokenResponseDto; | ||
return authService.kakaoLogin(accessToken); | ||
} | ||
|
||
|
||
@PostMapping(value = "/google-login") | ||
public BaseResponseDto googleLogin(HttpServletRequest request) { | ||
public BaseResponseDto<TokenResponseDto> googleLogin(HttpServletRequest request) { | ||
|
||
String accessToken = jwtTokenProvider.resolveToken(request); | ||
|
||
BaseResponseDto tokenResponseDto = authService.googleLogin(accessToken); | ||
|
||
LOGGER.info("구글 로그인 완료"); | ||
|
||
return tokenResponseDto; | ||
return authService.googleLogin(accessToken); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
} |
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
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
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
Oops, something went wrong.