目前自己的配置的redis 序列化只能 保持key 的正确存取;
若值为时间类型,则取出时会有问题。
解决办法:
在属性上加注解:@JsonDeserialize(using = LocalDateDeserializer.class)
@JsonSerialize(using = LocalDateSerializer.class)
@ApiModelProperty("结束日期")
@TableField("end_date")
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonDeserialize(using = LocalDateDeserializer.class)
@JsonSerialize(using = LocalDateSerializer.class)
private LocalDate endDate;
@ApiModelProperty(value = "创建时间")
@TableField("create_dt")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
protected LocalDateTime createDT;