use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsContentAdminController method refresh.
/**
* @param ids
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("refresh")
public String refresh(Long[] ids, HttpServletRequest request, HttpSession session, ModelMap model) {
if (CommonUtils.notEmpty(ids)) {
SysSite site = getSite(request);
service.refresh(site.getId(), ids);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "refresh.content", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsContentAdminController method sort.
/**
* @param id
* @param sort
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("sort")
public String sort(Long id, int sort, HttpServletRequest request, HttpSession session, ModelMap model) {
SysSite site = getSite(request);
if (CommonUtils.notEmpty(id)) {
CmsContent entity = service.sort(site.getId(), id, sort);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "sort.content", RequestUtils.getIpAddress(request), CommonUtils.getDate(), new StringBuilder().append(entity.getId()).append(":").append(entity.getTitle()).append(" to ").append(sort).toString()));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsContentAdminController method realDelete.
/**
* @param ids
* @param request
* @param session
* @return view name
*/
@RequestMapping("realDelete")
public String realDelete(Long[] ids, HttpServletRequest request, HttpSession session) {
SysSite site = getSite(request);
if (CommonUtils.notEmpty(ids)) {
service.realDelete(site.getId(), ids);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "realDelete.content", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsContentAdminController method uncheck.
/**
* @param ids
* @param request
* @param session
* @param model
* @return view name
*/
@RequestMapping("uncheck")
public String uncheck(Long[] ids, HttpServletRequest request, HttpSession session, ModelMap model) {
if (CommonUtils.notEmpty(ids)) {
SysSite site = getSite(request);
Long userId = getAdminFromSession(session).getId();
List<CmsContent> entityList = service.uncheck(site.getId(), userId, ids);
Set<Integer> categoryIdSet = new HashSet<>();
for (CmsContent entity : entityList) {
if (null != entity && site.getId() == entity.getSiteId()) {
if (CommonUtils.notEmpty(entity.getParentId())) {
publish(new Long[] { entity.getParentId() }, request, session, model);
}
publish(new Long[] { entity.getId() }, request, session, model);
categoryIdSet.add(entity.getCategoryId());
}
}
for (CmsCategory category : categoryService.getEntitys(categoryIdSet.toArray(new Integer[categoryIdSet.size()]))) {
templateComponent.createCategoryFile(site, category, null, null);
}
logOperateService.save(new LogOperate(site.getId(), userId, LogLoginService.CHANNEL_WEB_MANAGER, "uncheck.content", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, ',')));
}
return TEMPLATE_DONE;
}
use of com.publiccms.entities.log.LogOperate in project PublicCMS-preview by sanluan.
the class CmsModelAdminController 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);
Map<String, CmsModel> modelMap = modelComponent.getMap(site);
CmsModel entity = modelMap.remove(id);
if (null != entity) {
List<CmsModel> modelList = modelComponent.getList(site, entity.getId(), null, null, null, null);
for (CmsModel m : modelList) {
m.setParentId(null);
modelMap.put(m.getId(), m);
}
modelComponent.save(site, modelMap);
logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "delete.model", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
}
return TEMPLATE_DONE;
}
Aggregations