diff --git a/src/main/java/com/rymcu/forest/config/MybatisConfigurer.java b/src/main/java/com/rymcu/forest/config/MybatisConfigurer.java index 9aa708d..73aede7 100644 --- a/src/main/java/com/rymcu/forest/config/MybatisConfigurer.java +++ b/src/main/java/com/rymcu/forest/config/MybatisConfigurer.java @@ -40,12 +40,11 @@ public class MybatisConfigurer { pageHelper.setProperties(properties); //添加插件 - factory.setPlugins(new Interceptor[]{pageHelper}); + factory.setPlugins(pageHelper); //添加XML目录 ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); factory.setMapperLocations(resolver.getResources("classpath:mapper/**/*.xml")); -// factory.setTypeHandlersPackage("com.rymcu.forest.util.handlers"); return factory.getObject(); } diff --git a/src/main/java/com/rymcu/forest/entity/ForestFile.java b/src/main/java/com/rymcu/forest/entity/ForestFile.java index 58a8dfa..bcb7aee 100644 --- a/src/main/java/com/rymcu/forest/entity/ForestFile.java +++ b/src/main/java/com/rymcu/forest/entity/ForestFile.java @@ -1,5 +1,6 @@ package com.rymcu.forest.entity; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import javax.persistence.Column; @@ -21,13 +22,15 @@ public class ForestFile { @Id @GeneratedValue(generator = "JDBC") @Column(name = "id") + @JsonFormat(shape = JsonFormat.Shape.STRING) private Long id; /** * 文件大小 */ @Column(name = "file_size") - private long fileSize; + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long fileSize; /** * 文件类型-文件后缀 @@ -68,7 +71,8 @@ public class ForestFile { * 创建人 */ @Column(name = "created_by") - private long createdBy; + @JsonFormat(shape = JsonFormat.Shape.STRING) + private Long createdBy; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b28d3ae..1f0ad51 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -4,7 +4,7 @@ spring: thymeleaf: prefix: classpath:/templates/ suffix: .html - mode: LEGACYHTML5 + mode: HTML encoding: UTF-8 servlet: content-type: text/html