🎨 代码优化

This commit is contained in:
ronger 2022-08-27 22:15:41 +08:00
parent 4ee0aaacd4
commit 00a4c4bf70
3 changed files with 8 additions and 5 deletions

View File

@ -40,12 +40,11 @@ public class MybatisConfigurer {
pageHelper.setProperties(properties); pageHelper.setProperties(properties);
//添加插件 //添加插件
factory.setPlugins(new Interceptor[]{pageHelper}); factory.setPlugins(pageHelper);
//添加XML目录 //添加XML目录
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
factory.setMapperLocations(resolver.getResources("classpath:mapper/**/*.xml")); factory.setMapperLocations(resolver.getResources("classpath:mapper/**/*.xml"));
// factory.setTypeHandlersPackage("com.rymcu.forest.util.handlers");
return factory.getObject(); return factory.getObject();
} }

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -21,13 +22,15 @@ public class ForestFile {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id; private Long id;
/** /**
* 文件大小 * 文件大小
*/ */
@Column(name = "file_size") @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") @Column(name = "created_by")
private long createdBy; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long createdBy;
} }

View File

@ -4,7 +4,7 @@ spring:
thymeleaf: thymeleaf:
prefix: classpath:/templates/ prefix: classpath:/templates/
suffix: .html suffix: .html
mode: LEGACYHTML5 mode: HTML
encoding: UTF-8 encoding: UTF-8
servlet: servlet:
content-type: text/html content-type: text/html