| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- package egovframework.controller;
- import egovframework.service.impl.CommonServiceImpl;
- import egovframework.utill.TrafficData;
- import egovframework.vo.*;
- import lombok.RequiredArgsConstructor;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
- import javax.servlet.http.HttpServletRequest;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- @Slf4j
- @RequiredArgsConstructor
- @Controller
- public class CommonController {
- private final CommonServiceImpl commonService;
- @ResponseBody
- @RequestMapping(value = "/common/getWeatherInfo.do", method = {RequestMethod.POST, RequestMethod.GET})
- public WeatherInfoVO getWeather() {
- return this.commonService.getWeatherInfo();
- }
- @ResponseBody
- @RequestMapping(value = "/common/getLinkVertexArr.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<RoadVertexArrVO> getLinkVertexArr(HttpServletRequest request) {
- if (TrafficData.getLinkVertexArr() != null) {
- return TrafficData.getLinkVertexArr();
- }
- else {
- return this.commonService.getLinkVertexArr();
- }
- }
- @ResponseBody
- @RequestMapping(value = "/common/getIfscVertexArr.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<RoadVertexArrVO> getIfscVertexArr(HttpServletRequest request) {
- if (TrafficData.getIfscVertexArr() != null) {
- return TrafficData.getIfscVertexArr();
- }
- else {
- return this.commonService.getIfscVertexArr();
- }
- }
- @ResponseBody
- @RequestMapping(value = "/common/getRoadVertexArr.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<RoadVertexArrVO> getRoadVertexArr(HttpServletRequest request) {
- if (TrafficData.getRoadVertexArr() != null) {
- return TrafficData.getRoadVertexArr();
- }
- else {
- return this.commonService.getRoadVertexArr();
- }
- }
- @ResponseBody
- @RequestMapping(value = "/common/getVmsCtlr.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<VmsCtlrVO> getVmsCtlr() {
- return this.commonService.getVmsCtlr();
- }
- @ResponseBody
- @RequestMapping(value = "/common/getVmsPhaseImg.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<VmsCtlrVO> getVmsPhasImg(@RequestParam HashMap<String, String> paramMap) {
- return this.commonService.getVmsImgTxt(paramMap.get("vmsCtlrNmbr"));
- }
- @ResponseBody
- @RequestMapping(value = "/common/getCctvCtlr.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<CctvCtlrVO> getCctvCtlr() {
- return this.commonService.getCctvCtlr();
- }
- @ResponseBody
- @RequestMapping(value = "/common/getWcamCtlr.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<WcamCtlrVO> getWcamCtlr() {
- return this.commonService.getWcamCtlr();
- }
- @ResponseBody
- @RequestMapping(value = "/common/getIncdOcrr.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<IncdVO> getIncdOcrr() {
- return this.commonService.getIncdOcrr();
- }
- @ResponseBody
- @RequestMapping(value = "/common/getParkingInfo.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<ParkingInfoVO> getParkingInfo() {
- return this.commonService.getParkingInfo();
- }
- @ResponseBody
- @RequestMapping(value = "/parking/parking2.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<ParkingInfoVO> rtParking() {
- return this.commonService.rtParking();
- }
- @ResponseBody
- @RequestMapping(value = "/common/getNewParkingInfo.do", method = {RequestMethod.POST, RequestMethod.GET})
- public NewParkinginfoVO getNewParkingInfo(@RequestParam HashMap<String, String> paramMap) {
- return this.commonService.getNewParkingInfo(paramMap.get("parkId"));
- }
- @ResponseBody
- @RequestMapping(value = "/common/getNewParkingOcc.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<NewParkingOccVO> getNewParkingOcc(@RequestParam HashMap<String, String> paramMap) {
- return this.commonService.getNewParkingOcc(paramMap.get("parkId"));
- }
- @ResponseBody
- @RequestMapping(value = "/common/getTaasInfo.do", method = {RequestMethod.POST, RequestMethod.GET})
- public List<TaasVO> getTaasInfo() {
- List<TaasVO> tassList = this.commonService.getTaasInfo();
- SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- SimpleDateFormat format = new SimpleDateFormat("yyyy년 MM월 dd일");
- for (TaasVO vo : tassList) {
- Date date;
- try {
- date = transFormat.parse(vo.getReport_date());
- vo.setReport_date(format.format(date));
- } catch (ParseException e) {
- throw new RuntimeException();
- }
- }
- return tassList;
- }
- @ResponseBody
- @RequestMapping(value = "/common/getVisitCount.do", method = {RequestMethod.POST, RequestMethod.GET})
- public VisitCountVO getVisitCount() {
- return this.commonService.getVisitCount();
- }
- }
|