로그인 관련 추가 수정
This commit is contained in:
parent
542721abc5
commit
942b2e7ecb
@ -1,5 +1,6 @@
|
||||
package com.interplug.qcast.biz.login;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -10,6 +11,9 @@ import com.interplug.qcast.biz.login.dto.LoginUser;
|
||||
import com.interplug.qcast.biz.login.dto.UserLoginResponse;
|
||||
import com.interplug.qcast.biz.login.dto.UserPassword;
|
||||
import com.interplug.qcast.biz.login.dto.UserResponse;
|
||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||
import com.interplug.qcast.config.Exception.QcastException;
|
||||
import com.interplug.qcast.config.message.Messages;
|
||||
import com.interplug.qcast.util.DefaultResponse;
|
||||
import com.interplug.qcast.util.InterfaceQsp;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -26,22 +30,18 @@ public class LoginService {
|
||||
@Value("${qsp.url}")
|
||||
private String qspUrl;
|
||||
|
||||
@Autowired
|
||||
Messages message;
|
||||
|
||||
// 로그인 처리
|
||||
public UserLoginResponse getLogin(LoginUser loginUser) throws Exception {
|
||||
if (loginUser == null)
|
||||
throw new IllegalArgumentException("DTO 설정이 필요합니다.");
|
||||
|
||||
if (loginUser.getLangCd() == null || "".equals(loginUser.getLangCd()))
|
||||
throw new IllegalArgumentException("Language Code" + "은(는) 필수값입니다.");
|
||||
|
||||
if (loginUser.getLastEditUser() == null || "".equals(loginUser.getLastEditUser()))
|
||||
throw new IllegalArgumentException("Last Edit User Id" + "은(는) 필수값입니다.");
|
||||
|
||||
if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId()))
|
||||
throw new IllegalArgumentException("Login Id" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Login Id"));
|
||||
|
||||
if (loginUser.getPwd() == null || "".equals(loginUser.getPwd()))
|
||||
throw new IllegalArgumentException("Password" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Password"));
|
||||
|
||||
UserLoginResponse userLoginResponse = null;
|
||||
|
||||
@ -61,60 +61,67 @@ public class LoginService {
|
||||
}
|
||||
|
||||
public UserResponse getUser(LoginUser loginUser) {
|
||||
log.info("Build Test");
|
||||
return loginMapper.getUser(loginUser);
|
||||
}
|
||||
|
||||
// 가입 신청 등록
|
||||
public DefaultResponse joinUser(JoinUser joinUser) throws Exception {
|
||||
if (joinUser == null)
|
||||
throw new IllegalArgumentException("DTO 설정이 필요합니다.");
|
||||
|
||||
if (joinUser.getLangCd() == null || "".equals(joinUser.getLangCd()))
|
||||
throw new IllegalArgumentException("Language Code" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Language Code"));
|
||||
|
||||
if (joinUser.getLastEditUser() == null || "".equals(joinUser.getLastEditUser()))
|
||||
throw new IllegalArgumentException("Last Edit User Id" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Last Edit User Id"));
|
||||
|
||||
if (joinUser.getStoreQcastNm() == null || "".equals(joinUser.getStoreQcastNm()))
|
||||
throw new IllegalArgumentException("Store QCast Name" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Store QCast Name"));
|
||||
|
||||
if (joinUser.getStoreQcastNmKana() == null || "".equals(joinUser.getStoreQcastNmKana()))
|
||||
throw new IllegalArgumentException("Store QCast Name Kana" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Store QCast Name Kana"));
|
||||
|
||||
if (joinUser.getPostCd() == null || "".equals(joinUser.getPostCd()))
|
||||
throw new IllegalArgumentException("Postal Code" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Postal Code"));
|
||||
|
||||
if (joinUser.getAddr() == null || "".equals(joinUser.getAddr()))
|
||||
throw new IllegalArgumentException("Address" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Address"));
|
||||
|
||||
if (joinUser.getTelNo() == null || "".equals(joinUser.getTelNo()))
|
||||
throw new IllegalArgumentException("Telephone" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Telephone"));
|
||||
|
||||
if (joinUser.getFax() == null || "".equals(joinUser.getFax()))
|
||||
throw new IllegalArgumentException("Fax" + "은(는) 필수값입니다.");
|
||||
|
||||
if (joinUser.getUserInfo() == null)
|
||||
throw new IllegalArgumentException("사용자 정보 DTO 설정이 필요합니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Fax"));
|
||||
|
||||
if (joinUser.getUserInfo().getUserId() == null || "".equals(joinUser.getUserInfo().getUserId()))
|
||||
throw new IllegalArgumentException("User Id" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "User Id"));
|
||||
|
||||
if (joinUser.getUserInfo().getUserNm() == null || "".equals(joinUser.getUserInfo().getUserNm()))
|
||||
throw new IllegalArgumentException("Name" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Name"));
|
||||
|
||||
if (joinUser.getUserInfo().getUserNmKana() == null
|
||||
|| "".equals(joinUser.getUserInfo().getUserNmKana()))
|
||||
throw new IllegalArgumentException("Name_Kana" + "은(는) 필수값입니다.");
|
||||
// if (joinUser.getUserInfo().getUserNmKana() == null
|
||||
// || "".equals(joinUser.getUserInfo().getUserNmKana()))
|
||||
// throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
// message.getMessage("common.message.required.data", "Name Kana"));
|
||||
|
||||
if (joinUser.getUserInfo().getTelNo() == null || "".equals(joinUser.getUserInfo().getTelNo()))
|
||||
throw new IllegalArgumentException("Telephone" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Telephone"));
|
||||
|
||||
if (joinUser.getUserInfo().getFax() == null || "".equals(joinUser.getUserInfo().getFax()))
|
||||
throw new IllegalArgumentException("Fax" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Fax"));
|
||||
|
||||
if (joinUser.getUserInfo().getEmail() == null || "".equals(joinUser.getUserInfo().getEmail()))
|
||||
throw new IllegalArgumentException("E-Mail" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "E-Mail"));
|
||||
|
||||
// QSP API Call..
|
||||
// Q.CAST 신규 사용자 요청
|
||||
@ -134,20 +141,13 @@ public class LoginService {
|
||||
|
||||
// 비밀번호 초기화
|
||||
public DefaultResponse initPassword(UserPassword userPassword) throws Exception {
|
||||
if (userPassword == null)
|
||||
throw new IllegalArgumentException("DTO 설정이 필요합니다.");
|
||||
|
||||
if (userPassword.getLangCd() == null || "".equals(userPassword.getLangCd()))
|
||||
throw new IllegalArgumentException("Language Code" + "은(는) 필수값입니다.");
|
||||
|
||||
if (userPassword.getLastEditUser() == null || "".equals(userPassword.getLastEditUser()))
|
||||
throw new IllegalArgumentException("Last Edit User Id" + "은(는) 필수값입니다.");
|
||||
|
||||
if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId()))
|
||||
throw new IllegalArgumentException("Login Id" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Login Id"));
|
||||
|
||||
if (userPassword.getEmail() == null || "".equals(userPassword.getEmail()))
|
||||
throw new IllegalArgumentException("E-Mail" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "E-Mail"));
|
||||
|
||||
// QSP API Call..
|
||||
// Q.CAST 비밀번호 초기화
|
||||
@ -167,20 +167,17 @@ public class LoginService {
|
||||
|
||||
// 비밀번호 변경
|
||||
public DefaultResponse changePassword(UserPassword userPassword) throws Exception {
|
||||
if (userPassword == null)
|
||||
throw new IllegalArgumentException("DTO 설정이 필요합니다.");
|
||||
|
||||
if (userPassword.getLangCd() == null || "".equals(userPassword.getLangCd()))
|
||||
throw new IllegalArgumentException("Language Code" + "은(는) 필수값입니다.");
|
||||
|
||||
if (userPassword.getLastEditUser() == null || "".equals(userPassword.getLastEditUser()))
|
||||
throw new IllegalArgumentException("Last Edit User Id" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Last Edit User Id"));
|
||||
|
||||
if (userPassword.getPwd() == null || "".equals(userPassword.getPwd()))
|
||||
throw new IllegalArgumentException("Now Password" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Now Password"));
|
||||
|
||||
if (userPassword.getChgPwd() == null || "".equals(userPassword.getChgPwd()))
|
||||
throw new IllegalArgumentException("Change Password" + "은(는) 필수값입니다.");
|
||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
|
||||
message.getMessage("common.message.required.data", "Change Password"));
|
||||
|
||||
// QSP API Call..
|
||||
// Q.CAST 비밀번호 변경
|
||||
|
||||
@ -14,6 +14,7 @@ public class JoinUser {
|
||||
private String addr; // Address
|
||||
private String telNo; // Telephone
|
||||
private String fax; // Fax
|
||||
private String bizNo; // Business Registration No
|
||||
private String payTermsCd; // Pay Terms Code
|
||||
private String kamId; // Kam Id
|
||||
private String qtCompNm; // Quotation Company name
|
||||
|
||||
@ -4,8 +4,6 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LoginUser {
|
||||
private String langCd; // Language Code
|
||||
private String lastEditUser; // Last Edit User Id
|
||||
private String loginId; // Login Id
|
||||
private String pwd; // Password
|
||||
}
|
||||
|
||||
@ -22,5 +22,6 @@ public class UserResponse {
|
||||
private String fax; // Fax
|
||||
private String email; // E-Mail
|
||||
private String pwdInitYn; // Password Init Yn
|
||||
private String storeLvl; // Store Level
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user