1.log4j.properties日志管理
log4j.rootLogger=TRACE, stdout
log4j.logger.db.mapper=DEBUG
#定义打印的样式
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{
HH:mm:ss} %-5p %c{
1}:%L -%m%n
#关闭插件内的log4j日志信息
log4j.logger.org=OFF
log4j.logger.com=OFF
2.project.properties添加上传文件配置
#数据库配置信息
# suppress inspection "UnusedProperty"
jdbc.classPath=E:\\.m2\\repository\\mysql\\mysql-connector-java\\5.1.47\\mysql-connector-java-5.1.47.jar
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/td_peanut_cms_0103?characterEncoding=utf8&autoReconnect=true&useSSL=false
jdbc.username=td_peanut_0103
jdbc.password=dasd2131
#系统配置
system.debug=false
system.defaultMasterPassword=123456
#上传配置
system.upload.defaultEncoding=utf-8
system.upload.maxUploadSize=2127152
system.upload.maxUploadSizePerFile=2097152
system.upload.maxInMemorySize=1048576
system.upload.resolveLazily=true
3.test-LombokPlugin.java自动添加@JsonIgnore方法
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/9bb417e9a52de8c26b5a954f54f4b473.png)
package mbg;
import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.Field;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.java.TopLevelClass;
import java.util.List;
public class LombokPlugin extends PluginAdapter {
@Override
public boolean validate(List<String> warnings) {
return true;
}
@Override
public boolean modelBaseRecordClassGenerated(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
topLevelClass.addImportedType("lombok.Getter");
topLevelClass.addImportedType("lombok.Setter");
topLevelClass.addImportedType("lombok.ToString");
topLevelClass.addAnnotation("@Getter");
topLevelClass.addAnnotation("@Setter");
topLevelClass.addAnnotation("@ToString(callSuper=true)");
return true;
}
@Override
public boolean modelSetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
return false;
}
@Override
public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable