23 changed files with 1634 additions and 32 deletions
@ -0,0 +1,133 @@ |
|||||
|
package com.ccsens.cloudutil.aspect; |
||||
|
|
||||
|
import cn.hutool.core.util.ZipUtil; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.LogDto; |
||||
|
import com.ccsens.cloudutil.feign.TallFeignClient; |
||||
|
import com.ccsens.util.CodeEnum; |
||||
|
import com.ccsens.util.UploadFileUtil_Servlet3; |
||||
|
import com.ccsens.util.WebConstant; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import io.jsonwebtoken.Claims; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.annotation.Around; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.aspectj.lang.annotation.Pointcut; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.core.annotation.Order; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.servlet.ServletRequest; |
||||
|
import javax.servlet.ServletResponse; |
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.Part; |
||||
|
import java.lang.reflect.Method; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/10 10:06 |
||||
|
*/ |
||||
|
@Order(1) |
||||
|
@Slf4j |
||||
|
@Aspect |
||||
|
@Component |
||||
|
public class LogAspect { |
||||
|
|
||||
|
@Autowired |
||||
|
private TallFeignClient tallFeignClient; |
||||
|
|
||||
|
|
||||
|
@Pointcut("execution(* com.ccsens.tall.web..*(..)) || execution(* com.ccsens.ht.api..*(..))") |
||||
|
public void logAdvice(){ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Around("logAdvice()") |
||||
|
public Object around(ProceedingJoinPoint pjp){ |
||||
|
LogDto logDto = initLog(pjp); |
||||
|
|
||||
|
|
||||
|
Object result; |
||||
|
try { |
||||
|
result = pjp.proceed(); |
||||
|
} catch (Throwable throwable) { |
||||
|
log.error("方法运行异常", throwable); |
||||
|
if (logDto != null) { |
||||
|
String message = throwable.getMessage(); |
||||
|
logDto.setResult(message.length() > 1000 ? message.substring(0,1000) : message); |
||||
|
tallFeignClient.log(logDto); |
||||
|
} |
||||
|
|
||||
|
throw new BaseException(CodeEnum.SYS_ERROR); |
||||
|
} |
||||
|
if (logDto != null) { |
||||
|
String message = result == null ? null : result.toString().length() > 1000 ? result.toString().substring(0, 1000) : result.toString(); |
||||
|
logDto.setResult(message); |
||||
|
tallFeignClient.log(logDto); |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取方法路径、描述、参数 |
||||
|
* @param pjp |
||||
|
* @return |
||||
|
*/ |
||||
|
private LogDto initLog(ProceedingJoinPoint pjp) { |
||||
|
|
||||
|
//路径
|
||||
|
HttpServletRequest request = ((ServletRequestAttributes) |
||||
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
||||
|
String url = request.getServletPath(); |
||||
|
System.out.println("url:" + url); |
||||
|
String logUrl = "/log/operation"; |
||||
|
if (logUrl.equalsIgnoreCase(url)){ |
||||
|
log.info("保存日志,不进行记录"); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
LogDto dto = new LogDto(); |
||||
|
dto.setUrl(url); |
||||
|
//参数
|
||||
|
Object[] args = pjp.getArgs(); |
||||
|
StringBuilder param = new StringBuilder(); |
||||
|
//方法注解
|
||||
|
|
||||
|
Class<?>[] argTypes = new Class[args.length]; |
||||
|
for (int i = 0; i < args.length; i++) { |
||||
|
//参数类型
|
||||
|
argTypes[i] = args[i].getClass(); |
||||
|
//参数值
|
||||
|
if (args[i] instanceof ServletResponse) { |
||||
|
continue; |
||||
|
} else if (args[i] instanceof ServletRequest) { |
||||
|
Object claims = request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS); |
||||
|
String userId = claims == null ? null : ((Claims) claims).getSubject(); |
||||
|
if (userId != null) { |
||||
|
param.append("userId:").append(userId).append("--"); |
||||
|
} |
||||
|
} else if (args[i] instanceof Part) { |
||||
|
param.append("file:").append(UploadFileUtil_Servlet3.getFileNameByPart((Part)args[i])).append("--"); |
||||
|
}else { |
||||
|
param.append(args[i]).append("--"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
dto.setParams(param.length() > 1000 ? param.substring(0, 1000) : param.toString()); |
||||
|
try { |
||||
|
Method method = pjp.getTarget().getClass().getMethod(pjp.getSignature().getName(), argTypes); |
||||
|
ApiOperation annotation = method.getAnnotation(ApiOperation.class); |
||||
|
dto.setMethodDesc(annotation == null ? "" : annotation.value()); |
||||
|
} catch (Exception e) { |
||||
|
log.error("获取方法时异常",e); |
||||
|
} |
||||
|
|
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 18:01 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel |
||||
|
public class LogDto { |
||||
|
|
||||
|
private Long id; |
||||
|
@ApiModelProperty("接口地址") |
||||
|
private String url; |
||||
|
@ApiModelProperty("接口参数") |
||||
|
private String params; |
||||
|
@ApiModelProperty("接口描述") |
||||
|
private String methodDesc; |
||||
|
@ApiModelProperty("接口返回值(或异常)") |
||||
|
private String result; |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.ccsens.cloudutil.interceptor; |
||||
|
|
||||
|
import org.springframework.web.servlet.HandlerInterceptor; |
||||
|
import org.springframework.web.servlet.ModelAndView; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 18:24 |
||||
|
*/ |
||||
|
public class LogInterceptor implements HandlerInterceptor { |
||||
|
@Override |
||||
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
||||
|
//路径
|
||||
|
String path = request.getContextPath(); |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,196 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> |
||||
|
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> |
||||
|
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> |
||||
|
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> |
||||
|
<configuration scan="true" scanPeriod="10 seconds"> |
||||
|
|
||||
|
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />--> |
||||
|
|
||||
|
<contextName>logback</contextName> |
||||
|
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> |
||||
|
<property name="log.path" value="/home/cloud/ht/log/" /> |
||||
|
|
||||
|
<!-- 彩色日志 --> |
||||
|
<!-- 彩色日志依赖的渲染类 --> |
||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
||||
|
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
||||
|
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
||||
|
<!-- 彩色日志格式 --> |
||||
|
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
||||
|
|
||||
|
|
||||
|
<!--输出到控制台--> |
||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
||||
|
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
|
<level>info</level> |
||||
|
</filter> |
||||
|
<encoder> |
||||
|
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
||||
|
<!-- 设置字符集 --> |
||||
|
<charset>UTF-8</charset> |
||||
|
</encoder> |
||||
|
</appender> |
||||
|
|
||||
|
|
||||
|
<!--输出到文件--> |
||||
|
|
||||
|
<!-- 时间滚动输出 level为 DEBUG 日志 --> |
||||
|
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_debug.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> <!-- 设置字符集 --> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<!-- 日志归档 --> |
||||
|
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录debug级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>debug</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
<!-- 时间滚动输出 level为 INFO 日志 --> |
||||
|
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_info.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<!-- 每天日志归档路径以及格式 --> |
||||
|
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录info级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>info</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
<!-- 时间滚动输出 level为 WARN 日志 --> |
||||
|
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_warn.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录warn级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>warn</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
|
||||
|
<!-- 时间滚动输出 level为 ERROR 日志 --> |
||||
|
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
|
<file>${log.path}/log_error.log</file> |
||||
|
<!--日志文件输出格式--> |
||||
|
<encoder> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
||||
|
</encoder> |
||||
|
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
|
<maxFileSize>100MB</maxFileSize> |
||||
|
</timeBasedFileNamingAndTriggeringPolicy> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
</rollingPolicy> |
||||
|
<!-- 此日志文件只记录ERROR级别的 --> |
||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
|
<level>ERROR</level> |
||||
|
<onMatch>ACCEPT</onMatch> |
||||
|
<onMismatch>DENY</onMismatch> |
||||
|
</filter> |
||||
|
</appender> |
||||
|
|
||||
|
<!-- |
||||
|
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、 |
||||
|
以及指定<appender>。<logger>仅有一个name属性, |
||||
|
一个可选的level和一个可选的addtivity属性。 |
||||
|
name:用来指定受此logger约束的某一个包或者具体的某一个类。 |
||||
|
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
||||
|
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 |
||||
|
如果未设置此属性,那么当前logger将会继承上级的级别。 |
||||
|
addtivity:是否向上级logger传递打印信息。默认是true。 |
||||
|
--> |
||||
|
<!--<logger name="org.springframework.web" level="info"/>--> |
||||
|
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>--> |
||||
|
<!-- |
||||
|
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: |
||||
|
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 |
||||
|
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: |
||||
|
--> |
||||
|
|
||||
|
|
||||
|
<!-- |
||||
|
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 |
||||
|
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
||||
|
不能设置为INHERITED或者同义词NULL。默认是DEBUG |
||||
|
可以包含零个或多个元素,标识这个appender将会添加到这个logger。 |
||||
|
--> |
||||
|
|
||||
|
<!--开发环境:打印控制台--> |
||||
|
<springProfile name="dev"> |
||||
|
<logger name="com.ccsens.ptpro.persist.*" level="debug"/> |
||||
|
</springProfile> |
||||
|
|
||||
|
<root level="info"> |
||||
|
<appender-ref ref="CONSOLE" /> |
||||
|
<appender-ref ref="DEBUG_FILE" /> |
||||
|
<appender-ref ref="INFO_FILE" /> |
||||
|
<appender-ref ref="WARN_FILE" /> |
||||
|
<appender-ref ref="ERROR_FILE" /> |
||||
|
</root> |
||||
|
|
||||
|
<!--生产环境:输出到文件--> |
||||
|
<!--<springProfile name="pro">--> |
||||
|
<!--<root level="info">--> |
||||
|
<!--<appender-ref ref="CONSOLE" />--> |
||||
|
<!--<appender-ref ref="DEBUG_FILE" />--> |
||||
|
<!--<appender-ref ref="INFO_FILE" />--> |
||||
|
<!--<appender-ref ref="ERROR_FILE" />--> |
||||
|
<!--<appender-ref ref="WARN_FILE" />--> |
||||
|
<!--</root>--> |
||||
|
<!--</springProfile>--> |
||||
|
|
||||
|
</configuration> |
@ -0,0 +1,106 @@ |
|||||
|
package com.ccsens.tall.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class SysLog implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private String url; |
||||
|
|
||||
|
private String methodDesc; |
||||
|
|
||||
|
private String params; |
||||
|
|
||||
|
private String result; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getUrl() { |
||||
|
return url; |
||||
|
} |
||||
|
|
||||
|
public void setUrl(String url) { |
||||
|
this.url = url == null ? null : url.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getMethodDesc() { |
||||
|
return methodDesc; |
||||
|
} |
||||
|
|
||||
|
public void setMethodDesc(String methodDesc) { |
||||
|
this.methodDesc = methodDesc == null ? null : methodDesc.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getParams() { |
||||
|
return params; |
||||
|
} |
||||
|
|
||||
|
public void setParams(String params) { |
||||
|
this.params = params == null ? null : params.trim(); |
||||
|
} |
||||
|
|
||||
|
public String getResult() { |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
public void setResult(String result) { |
||||
|
this.result = result == null ? null : result.trim(); |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", url=").append(url); |
||||
|
sb.append(", methodDesc=").append(methodDesc); |
||||
|
sb.append(", params=").append(params); |
||||
|
sb.append(", result=").append(result); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,721 @@ |
|||||
|
package com.ccsens.tall.bean.po; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class SysLogExample { |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
protected boolean distinct; |
||||
|
|
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public SysLogExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria or() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
oredCriteria.add(criteria); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected Criteria createCriteriaInternal() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
protected abstract static class GeneratedCriteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected GeneratedCriteria() { |
||||
|
super(); |
||||
|
criteria = new ArrayList<Criterion>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getAllCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
if (condition == null) { |
||||
|
throw new RuntimeException("Value for condition cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value, String property) { |
||||
|
if (value == null) { |
||||
|
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
|
if (value1 == null || value2 == null) { |
||||
|
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNull() { |
||||
|
addCriterion("id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNotNull() { |
||||
|
addCriterion("id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdEqualTo(Long value) { |
||||
|
addCriterion("id =", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotEqualTo(Long value) { |
||||
|
addCriterion("id <>", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThan(Long value) { |
||||
|
addCriterion("id >", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("id >=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThan(Long value) { |
||||
|
addCriterion("id <", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("id <=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIn(List<Long> values) { |
||||
|
addCriterion("id in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotIn(List<Long> values) { |
||||
|
addCriterion("id not in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("id between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("id not between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlIsNull() { |
||||
|
addCriterion("url is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlIsNotNull() { |
||||
|
addCriterion("url is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlEqualTo(String value) { |
||||
|
addCriterion("url =", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotEqualTo(String value) { |
||||
|
addCriterion("url <>", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlGreaterThan(String value) { |
||||
|
addCriterion("url >", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("url >=", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlLessThan(String value) { |
||||
|
addCriterion("url <", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlLessThanOrEqualTo(String value) { |
||||
|
addCriterion("url <=", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlLike(String value) { |
||||
|
addCriterion("url like", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotLike(String value) { |
||||
|
addCriterion("url not like", value, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlIn(List<String> values) { |
||||
|
addCriterion("url in", values, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotIn(List<String> values) { |
||||
|
addCriterion("url not in", values, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlBetween(String value1, String value2) { |
||||
|
addCriterion("url between", value1, value2, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUrlNotBetween(String value1, String value2) { |
||||
|
addCriterion("url not between", value1, value2, "url"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescIsNull() { |
||||
|
addCriterion("method_desc is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescIsNotNull() { |
||||
|
addCriterion("method_desc is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescEqualTo(String value) { |
||||
|
addCriterion("method_desc =", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescNotEqualTo(String value) { |
||||
|
addCriterion("method_desc <>", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescGreaterThan(String value) { |
||||
|
addCriterion("method_desc >", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("method_desc >=", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescLessThan(String value) { |
||||
|
addCriterion("method_desc <", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescLessThanOrEqualTo(String value) { |
||||
|
addCriterion("method_desc <=", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescLike(String value) { |
||||
|
addCriterion("method_desc like", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescNotLike(String value) { |
||||
|
addCriterion("method_desc not like", value, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescIn(List<String> values) { |
||||
|
addCriterion("method_desc in", values, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescNotIn(List<String> values) { |
||||
|
addCriterion("method_desc not in", values, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescBetween(String value1, String value2) { |
||||
|
addCriterion("method_desc between", value1, value2, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMethodDescNotBetween(String value1, String value2) { |
||||
|
addCriterion("method_desc not between", value1, value2, "methodDesc"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsIsNull() { |
||||
|
addCriterion("params is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsIsNotNull() { |
||||
|
addCriterion("params is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsEqualTo(String value) { |
||||
|
addCriterion("params =", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsNotEqualTo(String value) { |
||||
|
addCriterion("params <>", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsGreaterThan(String value) { |
||||
|
addCriterion("params >", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("params >=", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsLessThan(String value) { |
||||
|
addCriterion("params <", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsLessThanOrEqualTo(String value) { |
||||
|
addCriterion("params <=", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsLike(String value) { |
||||
|
addCriterion("params like", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsNotLike(String value) { |
||||
|
addCriterion("params not like", value, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsIn(List<String> values) { |
||||
|
addCriterion("params in", values, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsNotIn(List<String> values) { |
||||
|
addCriterion("params not in", values, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsBetween(String value1, String value2) { |
||||
|
addCriterion("params between", value1, value2, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParamsNotBetween(String value1, String value2) { |
||||
|
addCriterion("params not between", value1, value2, "params"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultIsNull() { |
||||
|
addCriterion("result is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultIsNotNull() { |
||||
|
addCriterion("result is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultEqualTo(String value) { |
||||
|
addCriterion("result =", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultNotEqualTo(String value) { |
||||
|
addCriterion("result <>", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultGreaterThan(String value) { |
||||
|
addCriterion("result >", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("result >=", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultLessThan(String value) { |
||||
|
addCriterion("result <", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultLessThanOrEqualTo(String value) { |
||||
|
addCriterion("result <=", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultLike(String value) { |
||||
|
addCriterion("result like", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultNotLike(String value) { |
||||
|
addCriterion("result not like", value, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultIn(List<String> values) { |
||||
|
addCriterion("result in", values, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultNotIn(List<String> values) { |
||||
|
addCriterion("result not in", values, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultBetween(String value1, String value2) { |
||||
|
addCriterion("result between", value1, value2, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andResultNotBetween(String value1, String value2) { |
||||
|
addCriterion("result not between", value1, value2, "result"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNull() { |
||||
|
addCriterion("created_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNotNull() { |
||||
|
addCriterion("created_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtEqualTo(Date value) { |
||||
|
addCriterion("created_at =", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("created_at <>", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThan(Date value) { |
||||
|
addCriterion("created_at >", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at >=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThan(Date value) { |
||||
|
addCriterion("created_at <", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at <=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIn(List<Date> values) { |
||||
|
addCriterion("created_at in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("created_at not in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at not between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNull() { |
||||
|
addCriterion("updated_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNotNull() { |
||||
|
addCriterion("updated_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtEqualTo(Date value) { |
||||
|
addCriterion("updated_at =", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("updated_at <>", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThan(Date value) { |
||||
|
addCriterion("updated_at >", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at >=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThan(Date value) { |
||||
|
addCriterion("updated_at <", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at <=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIn(List<Date> values) { |
||||
|
addCriterion("updated_at in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("updated_at not in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNull() { |
||||
|
addCriterion("rec_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNotNull() { |
||||
|
addCriterion("rec_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusEqualTo(Byte value) { |
||||
|
addCriterion("rec_status =", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <>", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThan(Byte value) { |
||||
|
addCriterion("rec_status >", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status >=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThan(Byte value) { |
||||
|
addCriterion("rec_status <", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIn(List<Byte> values) { |
||||
|
addCriterion("rec_status in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("rec_status not in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status not between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criteria extends GeneratedCriteria { |
||||
|
|
||||
|
protected Criteria() { |
||||
|
super(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criterion { |
||||
|
private String condition; |
||||
|
|
||||
|
private Object value; |
||||
|
|
||||
|
private Object secondValue; |
||||
|
|
||||
|
private boolean noValue; |
||||
|
|
||||
|
private boolean singleValue; |
||||
|
|
||||
|
private boolean betweenValue; |
||||
|
|
||||
|
private boolean listValue; |
||||
|
|
||||
|
private String typeHandler; |
||||
|
|
||||
|
public String getCondition() { |
||||
|
return condition; |
||||
|
} |
||||
|
|
||||
|
public Object getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public Object getSecondValue() { |
||||
|
return secondValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isNoValue() { |
||||
|
return noValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isSingleValue() { |
||||
|
return singleValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isBetweenValue() { |
||||
|
return betweenValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isListValue() { |
||||
|
return listValue; |
||||
|
} |
||||
|
|
||||
|
public String getTypeHandler() { |
||||
|
return typeHandler; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.typeHandler = null; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.typeHandler = typeHandler; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this(condition, value, null); |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.typeHandler = typeHandler; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this(condition, value, secondValue, null); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.tall.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.tall.bean.po.SysLog; |
||||
|
import com.ccsens.tall.bean.po.SysLogExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface SysLogMapper { |
||||
|
long countByExample(SysLogExample example); |
||||
|
|
||||
|
int deleteByExample(SysLogExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(SysLog record); |
||||
|
|
||||
|
int insertSelective(SysLog record); |
||||
|
|
||||
|
List<SysLog> selectByExample(SysLogExample example); |
||||
|
|
||||
|
SysLog selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") SysLog record, @Param("example") SysLogExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") SysLog record, @Param("example") SysLogExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(SysLog record); |
||||
|
|
||||
|
int updateByPrimaryKey(SysLog record); |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.ccsens.tall.web; |
||||
|
|
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.LogDto; |
||||
|
import com.ccsens.tall.bean.po.SysLog; |
||||
|
import com.ccsens.tall.persist.mapper.SysLogMapper; |
||||
|
import com.ccsens.util.CodeEnum; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 18:04 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Api(tags = "接口调用日志" ) |
||||
|
@RestController |
||||
|
public class LogController { |
||||
|
|
||||
|
@Autowired |
||||
|
private SysLogMapper sysLogMapper; |
||||
|
@Autowired |
||||
|
private Snowflake snowflake; |
||||
|
|
||||
|
@RequestMapping("/log/operation") |
||||
|
public JsonResponse log(@RequestBody LogDto logDto) { |
||||
|
|
||||
|
SysLog log = new SysLog(); |
||||
|
BeanUtils.copyProperties(logDto, log); |
||||
|
log.setId(snowflake.nextId()); |
||||
|
sysLogMapper.insertSelective(log); |
||||
|
|
||||
|
|
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,258 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.tall.persist.mapper.SysLogMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.SysLog"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="url" jdbcType="VARCHAR" property="url" /> |
||||
|
<result column="method_desc" jdbcType="VARCHAR" property="methodDesc" /> |
||||
|
<result column="params" jdbcType="VARCHAR" property="params" /> |
||||
|
<result column="result" jdbcType="VARCHAR" property="result" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, url, method_desc, params, result, created_at, updated_at, rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysLogExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_sys_log |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_sys_log |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_sys_log |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.SysLogExample"> |
||||
|
delete from t_sys_log |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysLog"> |
||||
|
insert into t_sys_log (id, url, method_desc, |
||||
|
params, result, created_at, |
||||
|
updated_at, rec_status) |
||||
|
values (#{id,jdbcType=BIGINT}, #{url,jdbcType=VARCHAR}, #{methodDesc,jdbcType=VARCHAR}, |
||||
|
#{params,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysLog"> |
||||
|
insert into t_sys_log |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
url, |
||||
|
</if> |
||||
|
<if test="methodDesc != null"> |
||||
|
method_desc, |
||||
|
</if> |
||||
|
<if test="params != null"> |
||||
|
params, |
||||
|
</if> |
||||
|
<if test="result != null"> |
||||
|
result, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="url != null"> |
||||
|
#{url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="methodDesc != null"> |
||||
|
#{methodDesc,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="params != null"> |
||||
|
#{params,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="result != null"> |
||||
|
#{result,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysLogExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_sys_log |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_sys_log |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.url != null"> |
||||
|
url = #{record.url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.methodDesc != null"> |
||||
|
method_desc = #{record.methodDesc,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.params != null"> |
||||
|
params = #{record.params,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.result != null"> |
||||
|
result = #{record.result,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_sys_log |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
url = #{record.url,jdbcType=VARCHAR}, |
||||
|
method_desc = #{record.methodDesc,jdbcType=VARCHAR}, |
||||
|
params = #{record.params,jdbcType=VARCHAR}, |
||||
|
result = #{record.result,jdbcType=VARCHAR}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.SysLog"> |
||||
|
update t_sys_log |
||||
|
<set> |
||||
|
<if test="url != null"> |
||||
|
url = #{url,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="methodDesc != null"> |
||||
|
method_desc = #{methodDesc,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="params != null"> |
||||
|
params = #{params,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="result != null"> |
||||
|
result = #{result,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.SysLog"> |
||||
|
update t_sys_log |
||||
|
set url = #{url,jdbcType=VARCHAR}, |
||||
|
method_desc = #{methodDesc,jdbcType=VARCHAR}, |
||||
|
params = #{params,jdbcType=VARCHAR}, |
||||
|
result = #{result,jdbcType=VARCHAR}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,28 @@ |
|||||
|
package com.ccsens.util; |
||||
|
|
||||
|
import cn.hutool.core.codec.Base64; |
||||
|
import cn.hutool.core.util.ZipUtil; |
||||
|
import org.junit.Test; |
||||
|
|
||||
|
import java.io.UnsupportedEncodingException; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/10 15:44 |
||||
|
*/ |
||||
|
public class ZipTest { |
||||
|
@Test |
||||
|
public void gzip() throws UnsupportedEncodingException { |
||||
|
String content = "QueryDto(param=DoctorDto.Submit(positionId=1204239831257976832, titleId=1204239838740615168, name=李院长, sex=0, age=38), userId=1202064120040525824, token=null)--"; |
||||
|
System.out.println("content长度" + content.length()); |
||||
|
byte[] gzip = ZipUtil.gzip(content, "UTF-8"); |
||||
|
String encode = Base64.encode(gzip); |
||||
|
System.out.println("encode长度:" + encode.length()); |
||||
|
String zipContent = new String(gzip); |
||||
|
System.out.println(zipContent); |
||||
|
byte[] bytes = ZipUtil.unGzip(Base64.decode(encode)); |
||||
|
System.out.println("ungzip:" + new String(bytes, "UTF-8") ); |
||||
|
System.out.println("length:" + new String(bytes, "UTF-8").length()); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue