严智鑫
2025-11-13 945bc394f40d8af1072a53da9a94f24207124e6d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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";
        }
    }
}