가입 시 필수값 수정

This commit is contained in:
Kang Jung Kyo 2025-02-13 11:13:36 +09:00
parent a8430a83fd
commit 168e5e35fc

View File

@ -1,5 +1,9 @@
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;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.interplug.qcast.biz.login.dto.JoinUser;
@ -14,10 +18,6 @@ import com.interplug.qcast.util.DefaultResponse;
import com.interplug.qcast.util.InterfaceQsp;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@ -30,7 +30,8 @@ public class LoginService {
@Value("${qsp.url}")
private String qspUrl;
@Autowired Messages message;
@Autowired
Messages message;
/**
* 로그인 처리
@ -41,13 +42,11 @@ public class LoginService {
*/
public UserLoginResponse getLogin(LoginUser loginUser) throws Exception {
if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id"));
if (loginUser.getPwd() == null || "".equals(loginUser.getPwd()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Password"));
UserLoginResponse userLoginResponse = null;
@ -80,61 +79,56 @@ public class LoginService {
*/
public DefaultResponse joinUser(JoinUser joinUser) throws Exception {
if (joinUser.getStoreQcastNm() == null || "".equals(joinUser.getStoreQcastNm()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
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 QcastException(
ErrorCode.INVALID_INPUT_VALUE,
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 QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Postal Code"));
if (joinUser.getAddr() == null || "".equals(joinUser.getAddr()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Address"));
if (joinUser.getTelNo() == null || "".equals(joinUser.getTelNo()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Telephone"));
if (joinUser.getFax() == null || "".equals(joinUser.getFax()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Fax"));
if (joinUser.getBizNo() == null || "".equals(joinUser.getBizNo()))
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Business Registration No"));
// if (joinUser.getFax() == null || "".equals(joinUser.getFax()))
// 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 QcastException(
ErrorCode.INVALID_INPUT_VALUE,
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 QcastException(
ErrorCode.INVALID_INPUT_VALUE,
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 QcastException(ErrorCode.INVALID_INPUT_VALUE,
// message.getMessage("common.message.required.data", "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 QcastException(
ErrorCode.INVALID_INPUT_VALUE,
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 QcastException(
ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Fax"));
// if (joinUser.getUserInfo().getFax() == null || "".equals(joinUser.getUserInfo().getFax()))
// 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 QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "E-Mail"));
// QSP API Call..
@ -162,13 +156,11 @@ public class LoginService {
*/
public DefaultResponse initPassword(UserPassword userPassword) throws Exception {
if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id"));
if (userPassword.getEmail() == null || "".equals(userPassword.getEmail()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "E-Mail"));
// QSP API Call..
@ -196,18 +188,15 @@ public class LoginService {
*/
public DefaultResponse changePassword(UserPassword userPassword) throws Exception {
if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Login Id"));
if (userPassword.getChgType() == null || "".equals(userPassword.getChgType()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Change Type (I :Init , C: Change)"));
if (userPassword.getChgPwd() == null || "".equals(userPassword.getChgPwd()))
throw new QcastException(
ErrorCode.INVALID_INPUT_VALUE,
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE,
message.getMessage("common.message.required.data", "Change Password"));
// QSP API Call..