@JsonIgnore:隐藏返回值
@JsonFormat(pattern="yyyy-mm-dd hh:mm:ss", locale="zh", timezone="GMT+8"):时间格式化
@JsonInclude(JsonInclude.Include.NON_NULL):为空的返回值可忽略
SpringBoot开发环境热部署
1.首先引入相应的jar包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- optional=true, 依赖不会传递, 该项目依赖devtools;
之后依赖boot项目的项目如果想要使用devtools, 需要重新引入 -->
<optional>true</optional>
</dependency>
2.application.properties文件中配置属性
#关闭缓存,即时刷新
#spring.freemarker.cache=false
spring.thymeleaf.cache=true
#热部署生效
spring.devtools.restart.enabled=true
#设置重启的目录,添加那个目录的文件需要restart
spring.devtools.restart.additional-paths=src/main/java
SpringBoot资源文件属性配置
资源文件中的属性配置与映射到实体类
添加相关依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
如果出现乱码问题,可以访问https://tool.chinaz.com/tools/unicode.aspx进行转码

网友评论