Compare commits
No commits in common. "0b0e071753ed559e07fa80f3fa3ba27d999bce4d" and "e47be823e8fb15e09501fa981c6a625d71bd0cd0" have entirely different histories.
0b0e071753
...
e47be823e8
@ -59,20 +59,6 @@ public class LoginController {
|
|||||||
return loginService.getLogin(loginUser);
|
return loginService.getLogin(loginUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Q.CAST III에서 로그아웃한다.
|
|
||||||
*
|
|
||||||
* @param loginUser LoginUser
|
|
||||||
* @return DefaultResponse
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@Operation(description = "Q.CAST III에서 로그아웃한다.")
|
|
||||||
@PostMapping("/v1.0/logout")
|
|
||||||
@ResponseStatus(HttpStatus.CREATED)
|
|
||||||
public DefaultResponse logout(@RequestBody LoginUser loginUser) throws Exception {
|
|
||||||
return loginService.getLogout(loginUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/v1.0/user")
|
@PostMapping("/v1.0/user")
|
||||||
@ResponseStatus(HttpStatus.CREATED)
|
@ResponseStatus(HttpStatus.CREATED)
|
||||||
public UserResponse getUser(@RequestBody LoginUser loginUser) {
|
public UserResponse getUser(@RequestBody LoginUser loginUser) {
|
||||||
|
|||||||
@ -50,12 +50,6 @@ public class LoginService {
|
|||||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||||
message.getMessage("common.message.required.data", "Password"));
|
message.getMessage("common.message.required.data", "Password"));
|
||||||
|
|
||||||
loginUser.setAccsSiteCd("DESIGN");
|
|
||||||
loginUser.setActLog("LOGIN");
|
|
||||||
|
|
||||||
String sessionId = UUID.randomUUID().toString();
|
|
||||||
loginUser.setRequestId(sessionId);
|
|
||||||
|
|
||||||
UserLoginResponse userLoginResponse = null;
|
UserLoginResponse userLoginResponse = null;
|
||||||
|
|
||||||
// QSP API Call..
|
// QSP API Call..
|
||||||
@ -73,43 +67,12 @@ public class LoginService {
|
|||||||
if (userLoginResponse != null
|
if (userLoginResponse != null
|
||||||
&& userLoginResponse.getResult() != null
|
&& userLoginResponse.getResult() != null
|
||||||
&& "S".equalsIgnoreCase(userLoginResponse.getResult().getResultCode())) {
|
&& "S".equalsIgnoreCase(userLoginResponse.getResult().getResultCode())) {
|
||||||
userLoginResponse.setSessionId(sessionId);
|
userLoginResponse.setSessionId(UUID.randomUUID().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return userLoginResponse;
|
return userLoginResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 로그아웃 처리
|
|
||||||
*
|
|
||||||
* @param loginUser LoginUser
|
|
||||||
* @return DefaultResponse
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public DefaultResponse getLogout(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"));
|
|
||||||
|
|
||||||
loginUser.setAccsSiteCd("DESIGN");
|
|
||||||
loginUser.setActLog("LOGOUT");
|
|
||||||
|
|
||||||
// QSP API Call..
|
|
||||||
// Q.CAST 로그아웃
|
|
||||||
// post
|
|
||||||
// /api/user/logout
|
|
||||||
DefaultResponse defaultResponse = null;
|
|
||||||
String strResponse =
|
|
||||||
interfaceQsp.callApi(HttpMethod.POST, qspUrl + "/api/user/logout", loginUser);
|
|
||||||
if (!"".equals(strResponse)) {
|
|
||||||
ObjectMapper om =
|
|
||||||
new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
||||||
defaultResponse = om.readValue(strResponse, DefaultResponse.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
return defaultResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserResponse getUser(LoginUser loginUser) {
|
public UserResponse getUser(LoginUser loginUser) {
|
||||||
return loginMapper.getUser(loginUser);
|
return loginMapper.getUser(loginUser);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,4 @@ import lombok.Data;
|
|||||||
public class LoginUser {
|
public class LoginUser {
|
||||||
private String loginId; // Login Id
|
private String loginId; // Login Id
|
||||||
private String pwd; // Password
|
private String pwd; // Password
|
||||||
private String accsSiteCd; // Access Site Code (QSP, QORDER, QMUSUBI_DESIGN, QREAD, QWARRANTY, QPARTNERS)
|
|
||||||
private String actLog; // Action Log (LOGIN, AUTO_LOGIN, LOGOUT)
|
|
||||||
private String requestId; // Request ID <= Unique ID
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,4 @@ public class UserResponse {
|
|||||||
private String custNm;
|
private String custNm;
|
||||||
//시공사 번호
|
//시공사 번호
|
||||||
private String builderNo;
|
private String builderNo;
|
||||||
private String builderNm; // Builder Name
|
|
||||||
private String builderId; // Builder Id
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user