Browse Source

.

feature/auth
junheelee 2 years ago
parent
commit
736f08accc
  1. 45
      src/main/java/com/palnet/biz/api/acnt/crtfyhp/controller/AcntCrtfyhpController.java
  2. 9
      src/main/java/com/palnet/biz/api/acnt/crtfyhp/model/AcntCrtfyhpRsModel.java
  3. 2
      src/main/java/com/palnet/biz/api/acnt/crtfyhp/service/AcntCrtfyhpService.java

45
src/main/java/com/palnet/biz/api/acnt/crtfyhp/controller/AcntCrtfyhpController.java

@ -12,9 +12,8 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.palnet.biz.api.acnt.crtfyhp.model.AcntCrtfyhpRsModel;
import com.palnet.biz.api.acnt.crtfyhp.service.AcntCrtfyhpService;
import com.palnet.biz.api.acnt.cstmr.controller.AcntCstmrController;
import com.palnet.biz.api.acnt.cstmr.service.AcntCstmrService;
import com.palnet.biz.api.comn.response.BasicResponse;
import com.palnet.biz.api.comn.response.ErrorResponse;
import com.palnet.biz.api.comn.response.SuccessResponse;
@ -107,22 +106,48 @@ public class AcntCrtfyhpController {
}
//아이디 찾기 시 인증번호 발송 로직
@GetMapping(value = "/find/sendForId")
public boolean certifNum(String memberName, String hpno) throws Exception{
boolean result = service.certifNum(memberName, hpno);
public ResponseEntity<? extends BasicResponse> sendForId(String memberName, String hpno) {
Map<String , Boolean> resultMap = new HashMap<String,Boolean>();
log.info("result>>>>>>>>>>>>>>>>>>>>>>>> {}",result);
if(memberName == null || hpno == null) {
return ResponseEntity.status(HttpStatus.OK)
.body(new ErrorResponse(RSErrorCode.ER_PARAM));
}
return result;
try {
boolean result = service.certifNum(memberName, hpno);
resultMap.put("result" , result);
} catch (Exception e) {
log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1"));
}
return ResponseEntity.ok().body(new SuccessResponse<Map>(resultMap));
}
//아이디 찾기
@GetMapping(value = "/find/findUserId")
public String findUserId(String memberName, String hpno) throws Exception{
String result = service.findUserId(memberName,hpno);
public ResponseEntity<? extends BasicResponse> findUserId(String memberName, String hpno) {
AcntCrtfyhpRsModel model = new AcntCrtfyhpRsModel();
log.info("result>>>>>>>>>>>>>>>>>>>>>>>> {}",result);
if(memberName == null || hpno == null) {
return ResponseEntity.status(HttpStatus.OK)
.body(new ErrorResponse(RSErrorCode.ER_PARAM));
}
return result;
try {
model.setUserId(service.findUserId(memberName, hpno));
} catch (Exception e) {
log.error("IGNORE : {}", e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(new ErrorResponse("Server Error", "-1"));
}
return ResponseEntity.ok().body( new SuccessResponse<>(model));
}
@GetMapping(value = "/find/sendForPw")
public boolean certifNumPw(String userId, String hpno) throws Exception{
boolean result = service.certifPw(userId, hpno);

9
src/main/java/com/palnet/biz/api/acnt/crtfyhp/model/AcntCrtfyhpRsModel.java

@ -0,0 +1,9 @@
package com.palnet.biz.api.acnt.crtfyhp.model;
import lombok.Data;
@Data
public class AcntCrtfyhpRsModel {
// private int errCode;
private String userId;
}

2
src/main/java/com/palnet/biz/api/acnt/crtfyhp/service/AcntCrtfyhpService.java

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import com.palnet.biz.api.acnt.crtfyhp.model.AcntCrtfyhpRsModel;
import com.palnet.biz.api.acnt.cstmr.model.AcntCstmrRqModel;
import com.palnet.biz.api.acnt.cstmr.model.AcntCstmrRsModel;
import com.palnet.biz.api.acnt.cstmr.model.AnctCstmrTermsModel;
@ -220,6 +221,7 @@ public class AcntCrtfyhpService {
String name = EncryptUtils.encrypt(memberName);
String phone = EncryptUtils.encrypt(hpno);
String resultFindId = cstmrQuery.findUserId(name,phone);
return resultFindId;
}

Loading…
Cancel
Save