
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
package egovframework.com.site.web;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import egovframework.com.cmm.EgovMessageSource;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
import egovframework.com.site.service.SystemManageService;
import egovframework.com.site.service.SystemVO;
@Controller
public class SystemManageController {
private static final Logger LOGGER = LoggerFactory.getLogger(SystemManageController.class);
@Resource(name = "SystemManageService")
private SystemManageService systemManageService;
/** EgovMessageSource */
@Resource(name="egovMessageSource")
private EgovMessageSource egovMessageSource;
/**
* 시스템관리 - 기본정보 관리
*
* @param systemVO
* @return
* @throws Exception
*/
@RequestMapping(value = "/site/manageSystemView.do")
public String manageSystemView(@ModelAttribute("searchVO") SystemVO systemVO, ModelMap model) throws Exception {
// // 관리자 체크
// if (!EgovUserDetailsHelper.isRoleAdmin()) {
// return "redirect:/index.do";
// }
systemVO.setSysId(1);
SystemVO sysVO = systemManageService.selectSystemInfo(systemVO);
model.addAttribute("sysVO", sysVO);
return ".adminLayout/com/site/SystemManage";
}
/**
* 시스템관리 - 기본정보 등록
*
* @param systemVO
* @return
* @throws Exception
*/
@RequestMapping(value = "/site/insertSystemInfo.do")
public String insertSystemInfo(SystemVO systemVO, ModelMap model, RedirectAttributes redirectAttributes)
throws Exception {
// // 관리자 체크
// if (!EgovUserDetailsHelper.isRoleAdmin()) {
// return "redirect:/index.do";
// }
try {
systemManageService.insertSystemInfo(systemVO);
} catch (Exception ex) {
LOGGER.error(ex.getMessage());
model.addAttribute("msg", egovMessageSource.getMessage("fail.common.msg"));
return "forward:/site/manageSystemView.do";
}
redirectAttributes.addFlashAttribute("msg", egovMessageSource.getMessage("success.common.insert"));
return "redirect:/site/manageSystemView.do";
}
/**
* 시스템관리 - 기본정보 수정
*
* @param systemVO
* @return
* @throws Exception
*/
@RequestMapping(value = "/site/updateSystemInfo.do")
public String updateSystemInfo(SystemVO systemVO, ModelMap model, RedirectAttributes redirectAttributes)
throws Exception {
// // 관리자 체크
// if (!EgovUserDetailsHelper.isRoleAdmin()) {
// return "redirect:/index.do";
// }
try {
systemManageService.updateSystemInfo(systemVO);
} catch (Exception ex) {
LOGGER.error(ex.getMessage());
model.addAttribute("msg", egovMessageSource.getMessage("fail.common.msg"));
return "forward:/site/manageSystemView.do";
}
redirectAttributes.addFlashAttribute("msg", egovMessageSource.getMessage("success.common.update"));
return "redirect:/site/manageSystemView.do";
}
}