diff --git a/src/main/java/geoinfo/main/api/ApiController.java b/src/main/java/geoinfo/main/api/ApiController.java index 722623b8..87bf2c5d 100644 --- a/src/main/java/geoinfo/main/api/ApiController.java +++ b/src/main/java/geoinfo/main/api/ApiController.java @@ -3,6 +3,7 @@ package geoinfo.main.api; import java.util.HashMap; import java.util.Map; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -13,22 +14,30 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; +import egovframework.rte.psl.dataaccess.util.EgovMap; +import geoinfo.main.api.service.ApiService; import geoinfo.util.KeyGenerator; import ictway.comm.util.parseData; import ictway.comm.util.strUtil; -@Controller +@Controller public class ApiController { Logger log = Logger.getLogger(this.getClass()); - + + @Resource(name = "apiService") + private ApiService apiService; + /* * 사용자 > API 신청 화면 */ @RequestMapping(value = "apiKey.do") - public ModelAndView goApiKeyPage(ModelAndView model, @RequestParam HashMap params) throws Exception { - - + public ModelAndView goApiKeyPage(HttpServletRequest request, HttpServletResponse response, ModelAndView model, @RequestParam HashMap params) throws Exception { + + String loginUserId = String.valueOf(request.getSession().getAttribute("USERID")); + params.put("userid", loginUserId); + HashMap userLastApiKey = apiService.selectUserLatestKey(params); + model.addObject("userLastApiKey", userLastApiKey); model.setViewName("body/api/apiKey"); return model; diff --git a/src/main/java/geoinfo/main/api/service/ApiMapper.java b/src/main/java/geoinfo/main/api/service/ApiMapper.java new file mode 100644 index 00000000..bacb42d7 --- /dev/null +++ b/src/main/java/geoinfo/main/api/service/ApiMapper.java @@ -0,0 +1,17 @@ +package geoinfo.main.api.service; + +import java.util.HashMap; +import java.util.List; + +import egovframework.rte.psl.dataaccess.mapper.Mapper; +import egovframework.rte.psl.dataaccess.util.EgovMap; + +@Mapper("ApiMapper") +public interface ApiMapper { + + public int selectInfoListCnt(HashMap params) throws Exception; + + public List selectInfoList(HashMap params) throws Exception; + + HashMap selectUserLatestKey(HashMap params) throws Exception; +} diff --git a/src/main/java/geoinfo/main/api/service/ApiService.java b/src/main/java/geoinfo/main/api/service/ApiService.java new file mode 100644 index 00000000..fa3c8508 --- /dev/null +++ b/src/main/java/geoinfo/main/api/service/ApiService.java @@ -0,0 +1,15 @@ +package geoinfo.main.api.service; + +import java.util.HashMap; +import java.util.List; + +import egovframework.rte.psl.dataaccess.util.EgovMap; + +public interface ApiService { + + int selectInfoListCnt(HashMap params) throws Exception; + + List selectInfoList(HashMap params) throws Exception; + + HashMap selectUserLatestKey(HashMap params) throws Exception; +} diff --git a/src/main/java/geoinfo/main/api/service/impl/ApiServiceImpl.java b/src/main/java/geoinfo/main/api/service/impl/ApiServiceImpl.java new file mode 100644 index 00000000..294e54e0 --- /dev/null +++ b/src/main/java/geoinfo/main/api/service/impl/ApiServiceImpl.java @@ -0,0 +1,34 @@ +package geoinfo.main.api.service.impl; + +import java.util.HashMap; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import egovframework.rte.psl.dataaccess.util.EgovMap; +import geoinfo.main.api.service.ApiMapper; +import geoinfo.main.api.service.ApiService; + +@Service("apiService") +public class ApiServiceImpl implements ApiService{ + + @Resource(name="ApiMapper") + private ApiMapper ApiMapper; + + @Override + public int selectInfoListCnt(HashMap params) throws Exception { + return ApiMapper.selectInfoListCnt(params); + } + + @Override + public List selectInfoList(HashMap params) throws Exception { + return ApiMapper.selectInfoList(params); + } + + @Override + public HashMap selectUserLatestKey(HashMap params) throws Exception { + return ApiMapper.selectUserLatestKey(params); + } +} diff --git a/src/main/resources/egovframework/sqlmap/mapper/api/geoinfo/Api_SQL.xml b/src/main/resources/egovframework/sqlmap/mapper/api/geoinfo/Api_SQL.xml new file mode 100644 index 00000000..86ba23f4 --- /dev/null +++ b/src/main/resources/egovframework/sqlmap/mapper/api/geoinfo/Api_SQL.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/body/api/apiKey.jsp b/src/main/webapp/WEB-INF/views/body/api/apiKey.jsp index 3c74e695..1411d896 100644 --- a/src/main/webapp/WEB-INF/views/body/api/apiKey.jsp +++ b/src/main/webapp/WEB-INF/views/body/api/apiKey.jsp @@ -1,24 +1,62 @@ <%@ page language="java" contentType="text/html; charset=utf-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> - +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -
+ + + +<%--

API_SEQ: ${userLastApiKey.API_SEQ}

--%> +<%--

USERID: ${userLastApiKey.USERID}

--%> +<%--

USER_TYPE: ${userLastApiKey.USER_TYPE}

--%> +<%--

API_KEY: ${userLastApiKey.API_KEY}

--%> +<%--

START_DT:

--%> +<%--

END_DT:

--%> +<%--

APPROVE_YN: ${userLastApiKey.APPROVE_YN}

--%> + + +
+ + + + + + + + + + + + + + + + + + +
신청일만료일승인상태${userLastApiKey.APPROVE_YN eq 'Y' ? '승인' : '미승인'}
신청 KEY
${userLastApiKey.API_KEY}
+
+
+ + + + <%-- 사용자 타입(국토교통부/행정안전부/해안수산부/기타공공기관/일반) --%> +
    +
  • +
  • +
  • +
+ + + +
+
- <%-- 사용자 타입(국토교통부/행정안전부/해안수산부/기타공공기관/일반) --%> -
    -
  • -
  • -
  • -
- - -