refactor(trade): 优化 Kd100ExpressQueryRespDTO 中时间字段的反序列化方式

- 移除手动解析时间字符串的方法
- 使用 @JsonFormat 和 @JsonDeserialize 注解实现自动反序列化
- 提高代码简洁性和可维护性
This commit is contained in:
ningjingzhiyuan1024
2025-07-05 16:18:06 +08:00
parent c611f1ad15
commit 14a233afce

View File

@ -62,9 +62,8 @@ public class Kd100ExpressQueryRespDTO {
private String timeStr; private String timeStr;
@JsonProperty("time") @JsonProperty("time")
public void parseTime(String timeStr) { @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
this.time = LocalDateTime.parse(timeStr, DateTimeFormatter.ofPattern(FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); @JsonDeserialize(using = LocalDateTimeDeserializer.class)
}
private LocalDateTime time; private LocalDateTime time;
/** /**
* 轨迹描述 * 轨迹描述