Compare commits
No commits in common. "9392a116d2f60e2f0f839396cf0d0e8e3a4a5a22" and "1be2f3dcfc03856e6bc16142b99717c09617057c" have entirely different histories.
9392a116d2
...
1be2f3dcfc
|
|
@ -63,24 +63,4 @@ public class ApiController {
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "discardApiKey.do")
|
|
||||||
@ResponseBody
|
|
||||||
public Map<String, Object> discardApiKey(HttpServletRequest request, HttpServletResponse response, @RequestParam HashMap<String, Object> params) throws Exception {
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
|
||||||
strUtil sUtil = new strUtil();
|
|
||||||
String apiSeq = sUtil.checkNull(parseData.parseData((String)params.get("apiSeq")));
|
|
||||||
|
|
||||||
String loginUserId = String.valueOf(request.getSession().getAttribute("USERID"));
|
|
||||||
params.put("userid", loginUserId);
|
|
||||||
params.put("apiSeq", apiSeq);
|
|
||||||
|
|
||||||
resultMap = apiService.deleteWebApiKey(params);
|
|
||||||
//
|
|
||||||
// resultMap.put("code", params.get("p_result_code"));
|
|
||||||
// resultMap.put("msg", params.get("p_err_msg"));
|
|
||||||
// resultMap.put("data",params.get("apiKey"));
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,4 @@ public interface ApiMapper {
|
||||||
HashMap<String, Object> selectUserLatestKey(HashMap<String, Object> params) throws Exception;
|
HashMap<String, Object> selectUserLatestKey(HashMap<String, Object> params) throws Exception;
|
||||||
|
|
||||||
public HashMap<String, Object> spAddWebApiKey(HashMap<String, Object> params) throws SQLException;
|
public HashMap<String, Object> spAddWebApiKey(HashMap<String, Object> params) throws SQLException;
|
||||||
|
|
||||||
int deleteWebApiKey(HashMap<String, Object> params) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,4 @@ public interface ApiService {
|
||||||
HashMap<String, Object> selectUserLatestKey(HashMap<String, Object> params) throws Exception;
|
HashMap<String, Object> selectUserLatestKey(HashMap<String, Object> params) throws Exception;
|
||||||
|
|
||||||
HashMap<String, Object> addApiKey(HashMap<String, Object> params) throws Exception;
|
HashMap<String, Object> addApiKey(HashMap<String, Object> params) throws Exception;
|
||||||
|
|
||||||
HashMap<String, Object> deleteWebApiKey(HashMap<String, Object> params) throws Exception;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,26 +16,27 @@ import geoinfo.util.KeyGenerator;
|
||||||
public class ApiServiceImpl implements ApiService{
|
public class ApiServiceImpl implements ApiService{
|
||||||
|
|
||||||
@Resource(name="ApiMapper")
|
@Resource(name="ApiMapper")
|
||||||
private ApiMapper apiMapper;
|
private ApiMapper ApiMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int selectInfoListCnt(HashMap<String, Object> params) throws Exception {
|
public int selectInfoListCnt(HashMap<String, Object> params) throws Exception {
|
||||||
return apiMapper.selectInfoListCnt(params);
|
return ApiMapper.selectInfoListCnt(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<?> selectInfoList(HashMap<String, Object> params) throws Exception {
|
public List<?> selectInfoList(HashMap<String, Object> params) throws Exception {
|
||||||
return apiMapper.selectInfoList(params);
|
return ApiMapper.selectInfoList(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, Object> selectUserLatestKey(HashMap<String, Object> params) throws Exception {
|
public HashMap<String, Object> selectUserLatestKey(HashMap<String, Object> params) throws Exception {
|
||||||
return apiMapper.selectUserLatestKey(params);
|
return ApiMapper.selectUserLatestKey(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, Object> addApiKey(HashMap<String, Object> params) throws Exception {
|
public HashMap<String, Object> addApiKey(HashMap<String, Object> params) throws Exception {
|
||||||
|
|
||||||
|
HashMap<String, Object> rtnMap = null;
|
||||||
String retCode = "";
|
String retCode = "";
|
||||||
String retMsg = "";
|
String retMsg = "";
|
||||||
final int MAX_RETRY = 10;
|
final int MAX_RETRY = 10;
|
||||||
|
|
@ -46,7 +47,7 @@ public class ApiServiceImpl implements ApiService{
|
||||||
params.put("apiKey", apiKey);
|
params.put("apiKey", apiKey);
|
||||||
|
|
||||||
// 2. SP 호출
|
// 2. SP 호출
|
||||||
apiMapper.spAddWebApiKey(params);
|
rtnMap = ApiMapper.spAddWebApiKey(params);
|
||||||
retCode = (String) params.get("p_result_code");
|
retCode = (String) params.get("p_result_code");
|
||||||
retMsg = (String) params.get("p_err_msg");
|
retMsg = (String) params.get("p_err_msg");
|
||||||
|
|
||||||
|
|
@ -77,22 +78,4 @@ public class ApiServiceImpl implements ApiService{
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HashMap<String, Object> deleteWebApiKey(HashMap<String, Object> params) throws Exception {
|
|
||||||
HashMap<String, Object> result = new HashMap<String, Object>();
|
|
||||||
int resultCnt = 0;
|
|
||||||
|
|
||||||
resultCnt = apiMapper.deleteWebApiKey(params);
|
|
||||||
|
|
||||||
if (resultCnt > 0) {
|
|
||||||
result.put("code", "SUCCESS");
|
|
||||||
} else {
|
|
||||||
result.put("code", "ERROR");
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
FROM (SELECT *
|
FROM (SELECT *
|
||||||
FROM WEB_API_KEY
|
FROM WEB_API_KEY
|
||||||
WHERE USERID = #{userid}
|
WHERE USERID = #{userid}
|
||||||
-- AND END_DT >= SYSDATE
|
AND END_DT >= SYSDATE
|
||||||
ORDER BY END_DT DESC)
|
ORDER BY END_DT DESC)
|
||||||
WHERE ROWNUM = 1
|
WHERE ROWNUM = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -56,11 +56,4 @@
|
||||||
#{p_err_msg, mode=OUT, jdbcType=VARCHAR}
|
#{p_err_msg, mode=OUT, jdbcType=VARCHAR}
|
||||||
) }
|
) }
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- API KEY 갱신을 위하여 기존 키정보 삭제 -->
|
|
||||||
<delete id="deleteWebApiKey" parameterType="map">
|
|
||||||
DELETE
|
|
||||||
FROM WEB_API_KEY
|
|
||||||
WHERE API_SEQ = #{apiSeq}
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -8,14 +8,25 @@
|
||||||
|
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${not empty userLastApiKey}">
|
<c:when test="${not empty userLastApiKey}">
|
||||||
|
<!-- <div> -->
|
||||||
|
<%-- <p>API_SEQ: ${userLastApiKey.API_SEQ}</p> --%>
|
||||||
|
<%-- <p>USERID: ${userLastApiKey.USERID}</p> --%>
|
||||||
|
<%-- <p>USER_TYPE: ${userLastApiKey.USER_TYPE}</p> --%>
|
||||||
|
<%-- <p>API_KEY: ${userLastApiKey.API_KEY}</p> --%>
|
||||||
|
<%-- <p>START_DT: <fmt:formatDate value="${userLastApiKey.START_DT}" pattern="yyyy-MM-dd HH:mm:ss" /></p> --%>
|
||||||
|
<%-- <p>END_DT: <fmt:formatDate value="${userLastApiKey.END_DT}" pattern="yyyy-MM-dd HH:mm:ss" /></p> --%>
|
||||||
|
<%-- <p>APPROVE_YN: ${userLastApiKey.APPROVE_YN}</p> --%>
|
||||||
|
<!-- </div> -->
|
||||||
|
|
||||||
<div class="table-scrollable">
|
<div class="table-scrollable">
|
||||||
|
|
||||||
<table class="table table-bordered table-data">
|
<table class="table table-bordered table-data">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>신청일</th>
|
<th>신청일</th>
|
||||||
<td><fmt:formatDate value="${userLastApiKey.START_DT}" pattern="yyyy-MM-dd HH:mm" /></td>
|
<td><fmt:formatDate value="${userLastApiKey.START_DT}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
|
||||||
<th>만료일</th>
|
<th>만료일</th>
|
||||||
<td><fmt:formatDate value="${userLastApiKey.END_DT}" pattern="yyyy-MM-dd HH:mm" /></td>
|
<td><fmt:formatDate value="${userLastApiKey.END_DT}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
|
||||||
<th>승인상태</th>
|
<th>승인상태</th>
|
||||||
<td>${userLastApiKey.APPROVE_YN eq 'Y' ? '승인' : '미승인'}</td>
|
<td>${userLastApiKey.APPROVE_YN eq 'Y' ? '승인' : '미승인'}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -27,17 +38,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 현재 시간 생성 -->
|
|
||||||
<jsp:useBean id="now" class="java.util.Date" />
|
|
||||||
|
|
||||||
<!-- END_DT가 현재 시간보다 과거면 갱신 버튼 표시 -->
|
|
||||||
<c:if test="${userLastApiKey.END_DT.time lt now.time}">
|
|
||||||
<div class="row text-right">
|
|
||||||
<a href="javascript:void(0);" class="apiKeyReq btn btn-sm btn-green" onclick="javascript:discardApiKey();">갱신</a>
|
|
||||||
</div>
|
|
||||||
</c:if>
|
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<form name="frm" method="post">
|
<form name="frm" method="post">
|
||||||
|
|
@ -82,29 +83,5 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* [갱신] 버튼 클릭
|
|
||||||
* 만료일이 지나면 KEY를 새로 발급 받을 수 있다.
|
|
||||||
*/
|
|
||||||
function discardApiKey() {
|
|
||||||
var apiSeq = '${userLastApiKey.API_SEQ}'
|
|
||||||
$.ajax({
|
|
||||||
url : "/discardApiKey.do",
|
|
||||||
type : "post",
|
|
||||||
data : {apiSeq: apiSeq},
|
|
||||||
dataType :"json",
|
|
||||||
success : function(res){
|
|
||||||
if (res.code == "SUCCESS") {
|
|
||||||
alert("갱신을 위해 재신청하세요.")
|
|
||||||
location.reload();
|
|
||||||
} else {
|
|
||||||
alert(res.msg)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error : function(){
|
|
||||||
alert("오류입니다.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,15 +181,11 @@
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
</li>
|
</li>
|
||||||
<c:if test="${isLogin == true}">
|
|
||||||
<c:if test="${cls == 1}">
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#" onClick="gourl('apiKey')" onFocus="this.blur()" class="nav-link nav-toggle">
|
<a href="#" onClick="gourl('apiKey')" onFocus="this.blur()" class="nav-link nav-toggle">
|
||||||
<span class="title">API 신청</span>
|
<span class="title">API 신청</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</c:if>
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
<c:if test="${isLogin == true}">
|
<c:if test="${isLogin == true}">
|
||||||
<c:if test="${cls == 0}">
|
<c:if test="${cls == 0}">
|
||||||
|
|
|
||||||
|
|
@ -172,11 +172,7 @@
|
||||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" onClick="gourl('faq')" onFocus="this.blur()">시추정보 FAQ</a>
|
<a class="dropdown-toggle" data-toggle="dropdown" href="#" onClick="gourl('faq')" onFocus="this.blur()">시추정보 FAQ</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<c:if test="${isLogin == true}">
|
|
||||||
<c:if test="${cls == 1}">
|
|
||||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" onClick="gourl('apiKey')" onFocus="this.blur()">API 신청</a>
|
<a class="dropdown-toggle" data-toggle="dropdown" href="#" onClick="gourl('apiKey')" onFocus="this.blur()">API 신청</a>
|
||||||
</c:if>
|
|
||||||
</c:if>
|
|
||||||
</li>
|
</li>
|
||||||
<c:if test="${isLogin == true}">
|
<c:if test="${isLogin == true}">
|
||||||
<c:if test="${cls == 0}">
|
<c:if test="${cls == 0}">
|
||||||
|
|
|
||||||
|
|
@ -367,8 +367,6 @@
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
||||||
<c:if test="${eGovUrl == 'apiKey.do'}">
|
<c:if test="${eGovUrl == 'apiKey.do'}">
|
||||||
<c:if test="${isLogin == true}">
|
|
||||||
<c:if test="${cls == 1}">
|
|
||||||
<!-- 커뮤니티 > API 신청 시작 -->
|
<!-- 커뮤니티 > API 신청 시작 -->
|
||||||
<h1 class="page-title">
|
<h1 class="page-title">
|
||||||
<span class="page-title-text">API 신청</span>
|
<span class="page-title-text">API 신청</span>
|
||||||
|
|
@ -388,8 +386,6 @@
|
||||||
</script>
|
</script>
|
||||||
<!-- 커뮤니티 > 시추정보 Q&A 끝 -->
|
<!-- 커뮤니티 > 시추정보 Q&A 끝 -->
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:if>
|
|
||||||
</c:if>
|
|
||||||
|
|
||||||
<c:if test="${eGovUrl == 'homeEducationApplicationInquiry.do' || eGovUrl == 'homeEducationApplicationInput.do' }">
|
<c:if test="${eGovUrl == 'homeEducationApplicationInquiry.do' || eGovUrl == 'homeEducationApplicationInput.do' }">
|
||||||
<!-- 집합교육 신청 시작 -->
|
<!-- 집합교육 신청 시작 -->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue