자동 로그인 추적 #463
@ -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에서 로그아웃한다.
|
||||
*
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user