From 3f48d4b8d91db13ec3559b45179abccee0937c35 Mon Sep 17 00:00:00 2001 From: leebj Date: Tue, 25 Jun 2024 15:23:46 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=BB=A8=ED=8A=B8?= =?UTF-8?q?=EB=A1=A4=EB=9F=AC=20=EC=83=81=EC=86=8D=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/fims/MainController.java | 74 +++++++++---------- 1 file changed, 35 insertions(+), 39 deletions(-) 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