|
@@ -1,6 +1,7 @@
|
|
|
package com.style24.front.biz.web;
|
|
package com.style24.front.biz.web;
|
|
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
|
|
+import com.gagaframework.web.security.GagaPasswordEncoder;
|
|
|
import com.gagaframework.web.util.GagaStringUtil;
|
|
import com.gagaframework.web.util.GagaStringUtil;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.session.TscSession;
|
|
import com.style24.core.support.session.TscSession;
|
|
@@ -44,6 +45,9 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private NiceCertify niceCertify;
|
|
private NiceCertify niceCertify;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private GagaPasswordEncoder passwordEncoder;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 아이디 찾기 화면
|
|
* 아이디 찾기 화면
|
|
|
*
|
|
*
|
|
@@ -61,7 +65,7 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 아이디 찾기
|
|
|
|
|
|
|
+ * 아이디 찾기 - 고객정보
|
|
|
*
|
|
*
|
|
|
* @return ModelAndView
|
|
* @return ModelAndView
|
|
|
* @author jsshin
|
|
* @author jsshin
|
|
@@ -69,7 +73,7 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/id/find")
|
|
@PostMapping("/id/find")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
- public GagaMap getIdFind(@RequestBody Customer customer) {
|
|
|
|
|
|
|
+ public GagaMap getIdFindCustInfo(@RequestBody Customer customer) {
|
|
|
GagaMap result = new GagaMap();
|
|
GagaMap result = new GagaMap();
|
|
|
boolean isFind = false;
|
|
boolean isFind = false;
|
|
|
|
|
|
|
@@ -79,7 +83,7 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
|
|
|
|
|
Customer params = new Customer();
|
|
Customer params = new Customer();
|
|
|
// 인증방법
|
|
// 인증방법
|
|
|
- GagaMap authInfo = null;
|
|
|
|
|
|
|
+ GagaMap authInfo;
|
|
|
if (TscConstants.AuthMethod.CUSTINFO.value().equals(customer.getAuthMethod())) {
|
|
if (TscConstants.AuthMethod.CUSTINFO.value().equals(customer.getAuthMethod())) {
|
|
|
// 기본정보
|
|
// 기본정보
|
|
|
params.setCustNm(customer.getCustNm());
|
|
params.setCustNm(customer.getCustNm());
|
|
@@ -111,7 +115,6 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 비밀번호 찾기 화면
|
|
* 비밀번호 찾기 화면
|
|
|
*
|
|
*
|
|
@@ -129,13 +132,41 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 아이디 찾기
|
|
|
|
|
|
|
+ * 비밀번호 찾기 화면 - 아이디 확인
|
|
|
*
|
|
*
|
|
|
- * @return ModelAndView
|
|
|
|
|
|
|
+ * @param customer - custId
|
|
|
|
|
+ * @return GagaMap - 결과정보
|
|
|
* @author jsshin
|
|
* @author jsshin
|
|
|
- * @since 2021. 02. 08
|
|
|
|
|
|
|
+ * @since 2021. 02. 10
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("/id/check")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public GagaMap getIdCheck(@RequestBody Customer customer) {
|
|
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
|
|
+ boolean isFind = false;
|
|
|
|
|
+
|
|
|
|
|
+ if(StringUtils.isBlank(customer.getCustId())) {
|
|
|
|
|
+ throw new IllegalStateException("확인 할 아이디가 없습니다.");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Customer custInfo = customerService.getCustomerFindId(customer);
|
|
|
|
|
+ if (custInfo != null) {
|
|
|
|
|
+ isFind = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ result.setBoolean("isFind", isFind);
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 비밀번호 찾기 - 고객정보 찾기
|
|
|
|
|
+ * @param customer - 고객정보
|
|
|
|
|
+ * @return GagaMap
|
|
|
|
|
+ * @author jsshin
|
|
|
|
|
+ * @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
- @PostMapping("/pwd/find")
|
|
|
|
|
|
|
+ @PostMapping("/pwd/find/custinfo")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public GagaMap getPwdFind(@RequestBody Customer customer) {
|
|
public GagaMap getPwdFind(@RequestBody Customer customer) {
|
|
|
GagaMap result = new GagaMap();
|
|
GagaMap result = new GagaMap();
|
|
@@ -145,30 +176,28 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
throw new IllegalStateException("인증방법이 없습니다. <br>관리자에게 문의하시기 바랍니다.");
|
|
throw new IllegalStateException("인증방법이 없습니다. <br>관리자에게 문의하시기 바랍니다.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Customer params = new Customer();
|
|
|
|
|
- // 인증방법
|
|
|
|
|
- GagaMap authInfo = null;
|
|
|
|
|
- if (TscConstants.AuthMethod.CUSTINFO.value().equals(customer.getAuthMethod())) {
|
|
|
|
|
- // 기본정보
|
|
|
|
|
- params.setCustId(customer.getCustId());
|
|
|
|
|
- params.setCustNm(customer.getCustNm());
|
|
|
|
|
- params.setEmail(customer.getEmail());
|
|
|
|
|
- } else if (TscConstants.AuthMethod.MOBILE.value().equals(customer.getAuthMethod())) {
|
|
|
|
|
- // 핸드폰 인증
|
|
|
|
|
- authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
|
|
|
|
|
- params.setCi(authInfo.getString("sCi"));
|
|
|
|
|
- } else if (TscConstants.AuthMethod.IPIN.value().equals(customer.getAuthMethod())) {
|
|
|
|
|
- // 아이핀
|
|
|
|
|
- authInfo = niceCertify.getCertifyIpinResultInfo(customer);
|
|
|
|
|
- params.setCi(authInfo.getString("sConnInfo"));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 고객정보 찾기 - 아이디, 이름, 이메일
|
|
|
|
|
+ Customer custInfo = customerService.getCustomerFindId(customer);
|
|
|
|
|
|
|
|
- // 고객정보 찾기
|
|
|
|
|
- Customer custInfo = customerService.getCustomerFindId(params);
|
|
|
|
|
if (custInfo != null) {
|
|
if (custInfo != null) {
|
|
|
isFind = true;
|
|
isFind = true;
|
|
|
- result.setString("email", custInfo.getEmail());
|
|
|
|
|
- TscSession.setAttribute("custNo", String.valueOf(custInfo.getCustNo()));
|
|
|
|
|
|
|
+ result.setString("maskingEmail", custInfo.getMaskingEmail());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (isFind) {
|
|
|
|
|
+ String tempPasswd = customerService.getTemporaryPassword(10);
|
|
|
|
|
+ log.info("tempPasswd ====> {}", tempPasswd);
|
|
|
|
|
+ customer.setTempPasswdYn("Y"); // 임시비밀번호여부
|
|
|
|
|
+ customer.setPasswd(tempPasswd);
|
|
|
|
|
+ customer.setEncodedPasswd(passwordEncoder.encodeSha256(tempPasswd));
|
|
|
|
|
+ customer.setRegNo(custInfo.getCustNo());
|
|
|
|
|
+ customer.setUpdNo(custInfo.getCustNo());
|
|
|
|
|
+ customer.setCustNo(custInfo.getCustNo());
|
|
|
|
|
+
|
|
|
|
|
+ // 비밀번호 수정
|
|
|
|
|
+ customerService.saveCustomerPassword(customer);
|
|
|
|
|
+
|
|
|
|
|
+ // TODO: 2021.02.15 메일발송 서비스 붙여야함 - jsshin
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
result.setString("authMethod", customer.getAuthMethod()); // 인증방법
|
|
result.setString("authMethod", customer.getAuthMethod()); // 인증방법
|
|
@@ -177,33 +206,50 @@ public class TsfCustomerController extends TsfBaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 비밀번호 찾기 화면 - 아이디 확인
|
|
|
|
|
- *
|
|
|
|
|
- * @param customer - custId
|
|
|
|
|
- * @return GagaMap - 결과정보
|
|
|
|
|
|
|
+ * 비밀번호 찾기 - 인증(휴대폰,아이핀)
|
|
|
|
|
+ * @param customer - 고객정보
|
|
|
|
|
+ * @return GagaMap
|
|
|
* @author jsshin
|
|
* @author jsshin
|
|
|
- * @since 2021. 02. 10
|
|
|
|
|
|
|
+ * @since 2021. 02. 15
|
|
|
*/
|
|
*/
|
|
|
- @PostMapping("/id/check")
|
|
|
|
|
|
|
+ @PostMapping("/pwd/find/certify")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
- public GagaMap getIdCheck(@RequestBody Customer customer) {
|
|
|
|
|
|
|
+ public GagaMap getPwdFindCertify(@RequestBody Customer customer) {
|
|
|
GagaMap result = new GagaMap();
|
|
GagaMap result = new GagaMap();
|
|
|
boolean isFind = false;
|
|
boolean isFind = false;
|
|
|
|
|
|
|
|
- if(StringUtils.isBlank(customer.getCustId())) {
|
|
|
|
|
- throw new IllegalStateException("확인 할 아이디가 없습니다.");
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(customer.getAuthMethod())) {
|
|
|
|
|
+ throw new IllegalStateException("인증방법이 없습니다. <br>관리자에게 문의하시기 바랍니다.");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Customer custInfo = customerService.getCustomerFindId(customer);
|
|
|
|
|
|
|
+ Customer params = new Customer();
|
|
|
|
|
+ // 인증방법
|
|
|
|
|
+ GagaMap authInfo;
|
|
|
|
|
+ if (TscConstants.AuthMethod.MOBILE.value().equals(customer.getAuthMethod())) {
|
|
|
|
|
+ // 핸드폰 인증
|
|
|
|
|
+ authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
|
|
|
|
|
+ params.setCi(authInfo.getString("sCi"));
|
|
|
|
|
+ } else if (TscConstants.AuthMethod.IPIN.value().equals(customer.getAuthMethod())) {
|
|
|
|
|
+ // 아이핀
|
|
|
|
|
+ authInfo = niceCertify.getCertifyIpinResultInfo(customer);
|
|
|
|
|
+ params.setCi(authInfo.getString("sConnInfo"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 고객정보 찾기
|
|
|
|
|
+ Customer custInfo = customerService.getCustomerFindId(params);
|
|
|
if (custInfo != null) {
|
|
if (custInfo != null) {
|
|
|
isFind = true;
|
|
isFind = true;
|
|
|
|
|
+ TscSession.setAttribute("custNo", String.valueOf(custInfo.getCustNo()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ result.setString("authMethod", customer.getAuthMethod()); // 인증방법
|
|
|
result.setBoolean("isFind", isFind);
|
|
result.setBoolean("isFind", isFind);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 비밀번호 찾기 결과 화면
|
|
* 비밀번호 찾기 결과 화면
|
|
|
*
|
|
*
|