Search in sources :

Example 6 with SysAppClient

use of com.publiccms.entities.sys.SysAppClient in project PublicCMS-preview by sanluan.

the class SysAppClientAdminController 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) {
    SysAppClient entity = service.getEntity(id);
    if (null != entity) {
        SysSite site = getSite(request);
        if (ControllerUtils.verifyNotEquals("siteId", site.getId(), entity.getId().getSiteId(), model)) {
            return TEMPLATE_ERROR;
        }
        service.updateStatus(id, true);
        logOperateService.save(new LogOperate(site.getId(), getAdminFromSession(session).getId(), LogLoginService.CHANNEL_WEB_MANAGER, "disable.appclient", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(entity)));
    }
    return TEMPLATE_DONE;
}
Also used : LogOperate(com.publiccms.entities.log.LogOperate) SysAppClient(com.publiccms.entities.sys.SysAppClient) SysSite(com.publiccms.entities.sys.SysSite) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

SysAppClient (com.publiccms.entities.sys.SysAppClient)6 SysAppClientId (com.publiccms.entities.sys.SysAppClientId)3 SysSite (com.publiccms.entities.sys.SysSite)3 LogOperate (com.publiccms.entities.log.LogOperate)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 LogLogin (com.publiccms.entities.log.LogLogin)1 SysUserToken (com.publiccms.entities.sys.SysUserToken)1