use of com.publiccms.entities.sys.SysSite in project PublicCMS-preview by sanluan.
the class CmsWordAdminController method show.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("show")
public String show(Long id, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
CmsWord entity = service.getEntity(id);
if (null != entity) {
if (ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
service.updateStatus(id, false);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "show.word", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.sys.SysSite in project PublicCMS-preview by sanluan.
the class CmsWordAdminController method delete.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("delete")
public String delete(Long id, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
CmsWord entity = service.getEntity(id);
if (null != entity) {
if (ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
service.delete(id);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.word", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.sys.SysSite in project PublicCMS-preview by sanluan.
the class CmsWordAdminController method hidden.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("hidden")
public String hidden(Long id, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
CmsWord entity = service.getEntity(id);
if (null != entity) {
if (ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
service.updateStatus(id, true);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "hidden.word", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.sys.SysSite in project PublicCMS-preview by sanluan.
the class HomeBroadcastAdminController method disable.
/**
* @param id
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping(value = "disable", method = RequestMethod.POST)
public String disable(Long id, HttpServletRequest request, HttpSession session, ModelMap model) {
if (ControllerUtils.verifyEquals("admin.operate", getAdminFromSession(session).getId(), id, model)) {
return TEMPLATE_ERROR;
}
HomeBroadcast entity = service.getEntity(id);
if (null != entity) {
SysSite site = getSite(request);
if (ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getSiteId(), model)) {
return TEMPLATE_ERROR;
}
service.updateStatus(id, true);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "disable.home.broadcast", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.sys.SysSite in project PublicCMS-preview by sanluan.
the class ClearLogDirective method execute.
@Override
public void execute(RenderHandler handler) throws IOException, Exception {
Date date = handler.getDate("clearDate");
if (null == date) {
date = DateUtils.addMonths(CommonUtils.getDate(), -3);
}
SysSite site = getSite(handler);
Map<String, Integer> map = new HashMap<>();
map.put("loginLog:", logLoginService.delete(site.getId(), date));
map.put("operateLog:", logOperateService.delete(site.getId(), date));
map.put("taskLog:", logTaskService.delete(site.getId(), date));
handler.put("result", map).render();
}
Aggregations