@JsonFormat

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8"

不管是前端传后台,还是后台传前端,都可以用这个注解来解析时间

SaveInsuranceVo
    @NotNull(message = "投保时间不能为空" )
    @ApiModelProperty("投保时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date insuranceTime;
    @NotNull(message = "生效时间不能为空" )
    @ApiModelProperty("生效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date effectTime;
    @NotNull(message = "失效时间不能为空" )
    @ApiModelProperty("失效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date invalidTime;
    @NotBlank(message = "服务编码不能为空" )
    @ApiModelProperty("服务编码")
    private String serviceCode;
DoctorInsuranceDto
 @ApiModelProperty("投保时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date insuranceTime;
    @ApiModelProperty("生效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date effectTime;
    @ApiModelProperty("失效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date invalidTime;

 

posted on 2021-12-29 17:34  rachelgarden  阅读(730)  评论(0编辑  收藏  举报

导航