API 개인회원 신청가능하도록 처리, API 신청시 슬랙알림 기능 추가

This commit is contained in:
itn 2023-09-25 14:21:20 +09:00
parent df03e306de
commit 24030d9d21
3 changed files with 75 additions and 35 deletions

View File

@ -25,7 +25,12 @@ import itn.com.utl.fcc.service.EgovStringUtil;
import itn.let.mjo.apikey.service.ApiCallInfoMngService; import itn.let.mjo.apikey.service.ApiCallInfoMngService;
import itn.let.mjo.apikey.service.ApiKeyMngService; import itn.let.mjo.apikey.service.ApiKeyMngService;
import itn.let.mjo.apikey.service.ApiKeyVO; import itn.let.mjo.apikey.service.ApiKeyVO;
import itn.let.mjo.mjocommon.MjonCommon;
import itn.let.mjo.msg.service.MjonMsgService; import itn.let.mjo.msg.service.MjonMsgService;
import itn.let.sym.site.service.EgovSiteManagerService;
import itn.let.sym.site.service.JoinSettingVO;
import itn.let.uss.umt.service.EgovUserManageService;
import itn.let.utl.user.service.MjonNoticeSendUtil;
import itn.let.utl.user.service.SecuKeyUtil; import itn.let.utl.user.service.SecuKeyUtil;
/** /**
@ -60,9 +65,22 @@ public class ApiKeyMngController {
@Resource(name="egovMessageSource") @Resource(name="egovMessageSource")
EgovMessageSource egovMessageSource; EgovMessageSource egovMessageSource;
/** userManageService */
@Resource(name = "userManageService")
private EgovUserManageService userManageService;
/** 사이트 설정 */
@Resource(name = "egovSiteManagerService")
EgovSiteManagerService egovSiteManagerService;
/** 알림전송 Util */
@Resource(name = "mjonNoticeSendUtil")
private MjonNoticeSendUtil mjonNoticeSendUtil;
@Resource(name="MjonCommon")
private MjonCommon mjonCommon;
/* /*
//문자발송테스트 //문자발송테스트
@Resource(name = "mjonMsgSentTestService") @Resource(name = "mjonMsgSentTestService")
private MjonMsgSentTestService mjonMsgSentTestService; private MjonMsgSentTestService mjonMsgSentTestService;
@ -585,15 +603,19 @@ public class ApiKeyMngController {
try { try {
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
// 기업회원 확인 // 기업회원 확인 => 2023.09.25 JSPark 개인, 기업 모두 허용
/*
System.out.println("loginVO.getDept() :: "+ loginVO.getDept()); System.out.println("loginVO.getDept() :: "+ loginVO.getDept());
if(!"c".equals(loginVO.getDept())) { if(!"c".equals(loginVO.getDept())) {
modelAndView.addObject("message", "기업회원만 api 신청이 가능합니다."); modelAndView.addObject("message", "기업회원만 api 신청이 가능합니다.");
modelAndView.addObject("result", "deptC"); modelAndView.addObject("result", "deptC");
return modelAndView; return modelAndView;
} }
*/
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
String userNm = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getName());
System.out.println("1111111111112"); System.out.println("1111111111112");
ApiKeyVO apiKeyVO = new ApiKeyVO(); ApiKeyVO apiKeyVO = new ApiKeyVO();
apiKeyVO.setMberId(p_mberId); apiKeyVO.setMberId(p_mberId);
@ -624,10 +646,24 @@ public class ApiKeyMngController {
modelAndView.addObject("message", "api 신청이 완료되었습니다."); modelAndView.addObject("message", "api 신청이 완료되었습니다.");
modelAndView.addObject("result", "success"); modelAndView.addObject("result", "success");
// 법인폰 알람여부 체크
JoinSettingVO joinSettingVO = new JoinSettingVO();
joinSettingVO = egovSiteManagerService.selectAdminNotiDetail();
// SMS 체크
if (joinSettingVO != null && joinSettingVO.getSmsNoti().equals("Y")) {
// 스미싱의심 SMS 알림전송
mjonNoticeSendUtil.smishingSmsNoticeSend("API 신청", userId, userNm);
}
// SLACK 체크
if (joinSettingVO != null && joinSettingVO.getSlackNoti().equals("Y")) {
// Slack 메시지 발송(단순본문)
String msg = "[문자온] API 신청 - " + userNm +"("+ userId + ")";
mjonCommon.sendSimpleSlackMsg(msg);
}
}else { }else {
modelAndView.addObject("message", "api 신청이 실패했습니다."); modelAndView.addObject("message", "api 신청이 실패했습니다.");
modelAndView.addObject("result", "fail"); modelAndView.addObject("result", "fail");
} }
}catch(Exception e) { }catch(Exception e) {

View File

@ -242,6 +242,7 @@ function fn_reg_user_4_apikey(){
var form = document.checkForm; var form = document.checkForm;
var data = new FormData(form); var data = new FormData(form);
if(confirm("API 신청하시겠습니까?")) {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/uss/ion/apikey/UserAPIInsertAPIKEYAjax.do", url: "/uss/ion/apikey/UserAPIInsertAPIKEYAjax.do",
@ -272,8 +273,7 @@ function fn_reg_user_4_apikey(){
location.reload(); location.reload();
} }
}); });
}
} }
</script> </script>

View File

@ -44,6 +44,9 @@ function usrDeptChk(){
var usrDept = '${LoginVO.dept}'; var usrDept = '${LoginVO.dept}';
return true;
/* 2023.09.25 JSPark 개인, 기업 모두 허용
// 기업회원 전용체크 // 기업회원 전용체크
if(usrDept != 'c'){ if(usrDept != 'c'){
@ -54,6 +57,7 @@ function usrDeptChk(){
}else{ }else{
return true; return true;
} }
*/
} }
// 튤팁에서 취소 클릭 시 이벤트 // 튤팁에서 취소 클릭 시 이벤트