修改文件
application.yml
spring:
application:
name: springbootauth
jackson:
date-format: yyyy-MM-dd HH:mm:ss
generator:
write-bigdecimal-as-plain: true
write-numbers-as-strings: true
time-zone: GMT+8
时间格式化:
在实体上添加注解,可响应客户端格式化,可接受前端格式化的内容
@JsonFormat(locale = "zh",timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
如果说要前端输入日期字符串类型,进行解析
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
lang转换为String输出web段,避免精度缺失,在字段上添加注解
@JsonSerialize(using = com.fasterxml.jackson.databind.ser.std.ToStringSerializer.class)
最后修改于 2021-07-12 16:50:27
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付

