use of com.publiccms.entities.sys.SysDomain in project PublicCMS-preview by sanluan.
the class SysDomainAdminController method delete.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("delete")
public String delete(String id, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
if (ControllerUtils.verifyCustom("noright", !siteComponent.isMaster(site.getId()), model)) {
return TEMPLATE_ERROR;
}
SysDomain entity = service.getEntity(id);
if (null != entity) {
service.delete(id);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.domain", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
siteComponent.clear();
return TEMPLATE_DONE;
}
use of com.publiccms.entities.sys.SysDomain in project PublicCMS-preview by sanluan.
the class SysDomainAdminController method saveConfig.
/**
* @param entity
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("saveConfig")
public String saveConfig(SysDomain entity, HttpServletRequest request, HttpSession session, ModelMap model) {
if (CommonUtils.notEmpty(entity.getName())) {
SysSite site = getSite(request);
SysDomain oldEntity = service.getEntity(entity.getName());
if (null == oldEntity || ControllerUtils.verifyNotEquals("siteId", site.getId(), oldEntity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
entity = service.update(entity.getName(), entity, ignoreProperties);
if (null != entity) {
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "update.domain", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
siteComponent.clear();
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.sys.SysDomain in project PublicCMS-preview by sanluan.
the class SysSiteAdminController method delete.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@SuppressWarnings("unchecked")
@RequestMapping("delete")
public String delete(Short id, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
if (ControllerUtils.verifyCustom("noright", !siteComponent.isMaster(site.getId()), model)) {
return TEMPLATE_ERROR;
}
SysSite entity = service.getEntity(id);
if (null != entity) {
service.delete(id);
Long userId = getAdminFromSession(session).getId();
Date now = CommonUtils.getDate();
String ip = RequestUtils.getIpAddress(request);
for (SysDomain domain : (List<SysDomain>) domainService.getPage(entity.getId(), null, null, null).getList()) {
domainService.delete(domain.getName());
logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "delete.domain", ip, now, JsonUtils.getString(entity)));
}
logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "delete.site", ip, now, JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
Aggregations