API 개인회원 신청가능하도록 처리, API 신청시 슬랙알림 기능 추가
This commit is contained in:
parent
df03e306de
commit
24030d9d21
@ -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) {
|
||||||
|
|||||||
@ -242,38 +242,38 @@ function fn_reg_user_4_apikey(){
|
|||||||
var form = document.checkForm;
|
var form = document.checkForm;
|
||||||
var data = new FormData(form);
|
var data = new FormData(form);
|
||||||
|
|
||||||
$.ajax({
|
if(confirm("API 신청하시겠습니까?")) {
|
||||||
type: "POST",
|
$.ajax({
|
||||||
url: "/uss/ion/apikey/UserAPIInsertAPIKEYAjax.do",
|
type: "POST",
|
||||||
data: {
|
url: "/uss/ion/apikey/UserAPIInsertAPIKEYAjax.do",
|
||||||
"mberId": p_mberId
|
data: {
|
||||||
|
"mberId": p_mberId
|
||||||
|
},
|
||||||
|
dataType:'json',
|
||||||
|
success: function (returnData, status) {
|
||||||
|
if(returnData.result == 'success'){
|
||||||
|
alert("API KEY 사용자 등록을 하였습니다.");
|
||||||
|
location.reload();
|
||||||
|
}else if(returnData.result == 'db'){
|
||||||
|
alert("API KEY 사용자 등록을 실패하였습니다.(아이디 중복여부 확인해주세요)");
|
||||||
|
location.reload();
|
||||||
|
}else if(returnData.result == 'fail'){
|
||||||
|
alert("API KEY 사용자 등록을 실패하였습니다.(아이디 정상여부 확인해주세요)");
|
||||||
|
//location.reload();
|
||||||
|
}else if(returnData.result == 'deptC'){
|
||||||
|
alert(returnData.message);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
alert("API KEY 사용자 등록을 실패하였습니다.(아이디 중복 확인해주세요)");
|
||||||
|
location.href='<c:url value="/web/user/membershipChange.do" />';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
dataType:'json',
|
error: function (e) {
|
||||||
success: function (returnData, status) {
|
alert("API KEY 생성 실패하였습니다. 관리자에게 문의해 주세요");
|
||||||
if(returnData.result == 'success'){
|
|
||||||
alert("API KEY 사용자 등록을 하였습니다.");
|
|
||||||
location.reload();
|
location.reload();
|
||||||
}else if(returnData.result == 'db'){
|
|
||||||
alert("API KEY 사용자 등록을 실패하였습니다.(아이디 중복여부 확인해주세요)");
|
|
||||||
location.reload();
|
|
||||||
}else if(returnData.result == 'fail'){
|
|
||||||
alert("API KEY 사용자 등록을 실패하였습니다.(아이디 정상여부 확인해주세요)");
|
|
||||||
//location.reload();
|
|
||||||
}else if(returnData.result == 'deptC'){
|
|
||||||
alert(returnData.message);
|
|
||||||
|
|
||||||
}else{
|
|
||||||
alert("API KEY 사용자 등록을 실패하였습니다.(아이디 중복 확인해주세요)");
|
|
||||||
location.href='<c:url value="/web/user/membershipChange.do" />';
|
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
error: function (e) {
|
}
|
||||||
alert("API KEY 생성 실패하였습니다. 관리자에게 문의해 주세요");
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -43,7 +43,10 @@ $(document).ready(function(){
|
|||||||
function usrDeptChk(){
|
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;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// 튤팁에서 취소 클릭 시 이벤트
|
// 튤팁에서 취소 클릭 시 이벤트
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user