메인 컨트롤러 상속클래스 수정

main
이범준 5 months ago
parent 21651e5754
commit 3f48d4b8d9

@ -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<DataObject> 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<DataObject> 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<DataObject>) 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<DataObject> 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<DataObject> 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<DataObject>) item.get("children"));
}
}
}
}
Loading…
Cancel
Save