赞
踩
java.time.LocalDateTime
from Stringjava.time.LocalDate
from String@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ApiModelProperty(value = "开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime beginTime;
使用此注解需要引入Jackson的依赖
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.12.0</version>
</dependency>
一切搞定!!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。