From 1bf777f8a06dcf07c38d00b91383b277ba9109ca Mon Sep 17 00:00:00 2001 From: ysCha Date: Fri, 3 Apr 2026 13:17:27 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=90=EB=8F=99=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EC=B6=94=EC=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qcast/biz/login/LoginController.java | 14 +++++++++++++ .../qcast/biz/login/LoginService.java | 21 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/interplug/qcast/biz/login/LoginController.java b/src/main/java/com/interplug/qcast/biz/login/LoginController.java index 016431f7..23f29f80 100644 --- a/src/main/java/com/interplug/qcast/biz/login/LoginController.java +++ b/src/main/java/com/interplug/qcast/biz/login/LoginController.java @@ -59,6 +59,20 @@ public class LoginController { return loginService.getLogin(loginUser); } + /** + * Q.CAST III에 자동 로그인하여 사용자 정보를 획득한다. + * + * @param loginUser LoginUser + * @return UserLoginResponse + * @throws Exception + */ + @Operation(description = "Q.CAST III에 자동 로그인하여 사용자 정보를 획득한다.") + @PostMapping("/v1.0/autoLogin") + @ResponseStatus(HttpStatus.CREATED) + public UserLoginResponse autoLogin(@RequestBody LoginUser loginUser) throws Exception { + return loginService.getAutoLogin(loginUser); + } + /** * Q.CAST III에서 로그아웃한다. * diff --git a/src/main/java/com/interplug/qcast/biz/login/LoginService.java b/src/main/java/com/interplug/qcast/biz/login/LoginService.java index ceac3bfb..3391d274 100644 --- a/src/main/java/com/interplug/qcast/biz/login/LoginService.java +++ b/src/main/java/com/interplug/qcast/biz/login/LoginService.java @@ -50,8 +50,27 @@ public class LoginService { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Password")); + return callLoginApi(loginUser, "LOGIN"); + } + + /** + * 자동 로그인 처리 + * + * @param loginUser LoginUser + * @return UserLoginResponse + * @throws Exception + */ + public UserLoginResponse getAutoLogin(LoginUser loginUser) throws Exception { + if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId())) + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + message.getMessage("common.message.required.data", "Login Id")); + + return callLoginApi(loginUser, "AUTO_LOGIN"); + } + + private UserLoginResponse callLoginApi(LoginUser loginUser, String actLog) throws Exception { loginUser.setAccsSiteCd("DESIGN"); - loginUser.setActLog("LOGIN"); + loginUser.setActLog(actLog); String sessionId = UUID.randomUUID().toString(); loginUser.setRequestId(sessionId);