package com.northglass.web.systemmgmt;
|
|
import org.slf4j.Logger;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.ui.Model;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import com.northglass.log.GLoggerFactory;
|
import com.northglass.service.system.SystemService;
|
|
@Controller
|
@RequestMapping(value="/systemmgmt")
|
public class SystemMgmtController {
|
private static final Logger LOGGER = GLoggerFactory.getLogger(SystemMgmtController.class);
|
@Autowired
|
private SystemService service;
|
|
@RequestMapping(method=RequestMethod.GET)
|
public String list() {
|
return "systemmgmt/list";
|
}
|
|
@RequestMapping(method=RequestMethod.GET, value="/initializeDatabase")
|
public String initializeDatabase(Model model) throws ClassNotFoundException {
|
LOGGER.debug("initializeDatabase");
|
if (service.initializeDatabase()) {
|
return "systemmgmt/initializeDatabaseSuccess";
|
}else {
|
return "systemmgmt/initializeDatabaseFail";
|
}
|
}
|
}
|