Java Code Examples for org.jeecg.modules.system.entity.SysLog#setOperateType()
The following examples show how to use
org.jeecg.modules.system.entity.SysLog#setOperateType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutoLogAspect.java From jeecg-cloud with Apache License 2.0 | 4 votes |
private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); SysLog sysLog = new SysLog(); AutoLog syslog = method.getAnnotation(AutoLog.class); if(syslog != null){ //注解上的描述,操作日志内容 sysLog.setLogContent(syslog.value()); sysLog.setLogType(syslog.logType()); } //请求的方法名 String className = joinPoint.getTarget().getClass().getName(); String methodName = signature.getName(); sysLog.setMethod(className + "." + methodName + "()"); //设置操作类型 if (sysLog.getLogType() == CommonConstant.LOG_TYPE_2) { sysLog.setOperateType(getOperateType(methodName, syslog.operateType())); } //获取request HttpServletRequest request = SpringContextUtils.getHttpServletRequest(); //请求的参数 sysLog.setRequestParam(getReqestParams(request,joinPoint)); //设置IP地址 sysLog.setIp(IPUtils.getIpAddr(request)); //获取登录用户信息 LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); if(sysUser!=null){ sysLog.setUserid(sysUser.getUsername()); sysLog.setUsername(sysUser.getRealname()); } //耗时 sysLog.setCostTime(time); sysLog.setCreateTime(new Date()); //保存系统日志 JSONObject jsonObject = (JSONObject) JSONObject.toJSON(sysLog); sysBaseRemoteApi.saveSysLog(jsonObject); }
Example 2
Source File: AutoLogAspect.java From jeecg-boot-with-activiti with MIT License | 4 votes |
private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); SysLog sysLog = new SysLog(); AutoLog syslog = method.getAnnotation(AutoLog.class); if(syslog != null){ //注解上的描述,操作日志内容 sysLog.setLogContent(syslog.value()); sysLog.setLogType(syslog.logType()); } //请求的方法名 String className = joinPoint.getTarget().getClass().getName(); String methodName = signature.getName(); sysLog.setMethod(className + "." + methodName + "()"); //设置操作类型 if (sysLog.getLogType() == CommonConstant.LOG_TYPE_2) { sysLog.setOperateType(getOperateType(methodName, syslog.operateType())); } //请求的参数 Object[] args = joinPoint.getArgs(); try{ String params = JSONObject.toJSONString(args); sysLog.setRequestParam(params); }catch (Exception e){ } //获取request HttpServletRequest request = SpringContextUtils.getHttpServletRequest(); //设置IP地址 sysLog.setIp(IPUtils.getIpAddr(request)); //获取登录用户信息 LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); if(sysUser!=null){ sysLog.setUserid(sysUser.getUsername()); sysLog.setUsername(sysUser.getRealname()); } //耗时 sysLog.setCostTime(time); sysLog.setCreateTime(new Date()); //保存系统日志 sysLogService.save(sysLog); }
Example 3
Source File: AutoLogAspect.java From teaching with Apache License 2.0 | 4 votes |
private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); SysLog sysLog = new SysLog(); AutoLog syslog = method.getAnnotation(AutoLog.class); if(syslog != null){ //注解上的描述,操作日志内容 sysLog.setLogContent(syslog.value()); sysLog.setLogType(syslog.logType()); } //请求的方法名 String className = joinPoint.getTarget().getClass().getName(); String methodName = signature.getName(); sysLog.setMethod(className + "." + methodName + "()"); //设置操作类型 if (sysLog.getLogType() == CommonConstant.LOG_TYPE_2) { sysLog.setOperateType(getOperateType(methodName, syslog.operateType())); } //请求的参数 Object[] args = joinPoint.getArgs(); try{ String params = JSONObject.toJSONString(args); sysLog.setRequestParam(params); }catch (Exception e){ } //获取request HttpServletRequest request = SpringContextUtils.getHttpServletRequest(); //设置IP地址 sysLog.setIp(IPUtils.getIpAddr(request)); //获取登录用户信息 LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); if(sysUser!=null){ sysLog.setUserid(sysUser.getUsername()); sysLog.setUsername(sysUser.getRealname()); } //耗时 sysLog.setCostTime(time); sysLog.setCreateTime(new Date()); //保存系统日志 sysLogService.save(sysLog); }
Example 4
Source File: AutoLogAspect.java From jeecg-boot with Apache License 2.0 | 4 votes |
private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Method method = signature.getMethod(); SysLog sysLog = new SysLog(); AutoLog syslog = method.getAnnotation(AutoLog.class); if(syslog != null){ //注解上的描述,操作日志内容 sysLog.setLogContent(syslog.value()); sysLog.setLogType(syslog.logType()); } //请求的方法名 String className = joinPoint.getTarget().getClass().getName(); String methodName = signature.getName(); sysLog.setMethod(className + "." + methodName + "()"); //设置操作类型 if (sysLog.getLogType() == CommonConstant.LOG_TYPE_2) { sysLog.setOperateType(getOperateType(methodName, syslog.operateType())); } //获取request HttpServletRequest request = SpringContextUtils.getHttpServletRequest(); //请求的参数 sysLog.setRequestParam(getReqestParams(request,joinPoint)); //设置IP地址 sysLog.setIp(IPUtils.getIpAddr(request)); //获取登录用户信息 LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); if(sysUser!=null){ sysLog.setUserid(sysUser.getUsername()); sysLog.setUsername(sysUser.getRealname()); } //耗时 sysLog.setCostTime(time); sysLog.setCreateTime(new Date()); //保存系统日志 sysLogService.save(sysLog); }