diff --git a/src/main/java/cokr/xit/fims/MainController.java b/src/main/java/cokr/xit/fims/MainController.java index 209e24c8..4fbd4cef 100644 --- a/src/main/java/cokr/xit/fims/MainController.java +++ b/src/main/java/cokr/xit/fims/MainController.java @@ -15,11 +15,10 @@ import cokr.xit.base.user.service.UserService; import cokr.xit.fims.mngt.service.bean.FimsOgdpBean; import cokr.xit.fims.task.TaskRequestMappingHandlerMapping; import cokr.xit.foundation.data.DataObject; -import cokr.xit.foundation.web.AbstractController; import cokr.xit.foundation.web.RequestHandlerReader; @Controller -public class MainController extends AbstractController { +public class MainController extends cokr.xit.base.web.MainController { @Autowired private TaskRequestMappingHandlerMapping requestHandlers; @@ -30,9 +29,40 @@ public class MainController extends AbstractController { @Resource(name="userService") private UserService userService; - @GetMapping(name="로그인", value="/login.do") - public String loginPage() { - return "login"; + @Override + public ModelAndView loginPage() { + return new ModelAndView("login"); + } + + @Override + public ModelAndView getURLs(boolean multiple) { + List urls = new RequestHandlerReader().read(requestHandlers); + attachTaskPrefixName(urls); + + return new ModelAndView("select-url") + .addObject("multiple", multiple) + .addObject("urls", toJson(urls)); + } + + @SuppressWarnings("unchecked") + private void attachTaskPrefixName(List list) { + for(DataObject item : list) { + String name = item.string("name"); + String url = item.string("url"); + if(!name.equals(url)) { + switch (url) { + case "/BPV": item.set("name","전용차로과태료업무 "+name); + case "/PVS": item.set("name","주정차위반과태료업무 "+name); + case "/DPV": item.set("name","장애인주차위반과태료업무 "+name); + case "/ECA": item.set("name","전기차주차위반과태료업무 "+name); + case "/PES": item.set("name","밤샘주차위반과태료업무 "+name); + case "/DVS": item.set("name","미세먼지과태료업무 "+name); + } + } + if(item.get("children") != null) { + attachTaskPrefixName((List) item.get("children")); + } + } } @GetMapping(name="회원가입 페이지", value="/signupPage.do") @@ -77,40 +107,6 @@ public class MainController extends AbstractController { } - @GetMapping(name="홈", value={"/", "/index.do"}) - public ModelAndView mainPage() { - return new ModelAndView("index"); - } - - @RequestMapping(name="기능 URL 선택", value="/urls.do") - public ModelAndView getURLs(boolean multiple) { - List urls = new RequestHandlerReader().read(requestHandlers); - attachTaskPrefixName(urls); - return new ModelAndView("select-url") - .addObject("multiple", multiple) - .addObject("urls", toJson(urls)); - } - - @SuppressWarnings("unchecked") - private void attachTaskPrefixName(List list) { - for(DataObject item : list) { - String name = item.string("name"); - String url = item.string("url"); - if(!name.equals(url)) { - switch (url) { - case "/BPV": item.set("name","전용차로과태료업무 "+name); - case "/PVS": item.set("name","주정차위반과태료업무 "+name); - case "/DPV": item.set("name","장애인주차위반과태료업무 "+name); - case "/ECA": item.set("name","전기차주차위반과태료업무 "+name); - case "/PES": item.set("name","밤샘주차위반과태료업무 "+name); - case "/DVS": item.set("name","미세먼지과태료업무 "+name); - } - } - if(item.get("children") != null) { - attachTaskPrefixName((List) item.get("children")); - } - } - } } \ No newline at end of file