자동 로그인 추적 #463

Merged
ysCha merged 1 commits from dev into dev-deploy 2026-04-03 13:36:29 +09:00
2 changed files with 34 additions and 1 deletions

View File

@ -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에서 로그아웃한다.
*

View File

@ -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);