我是Mapstruct的新手。我有一个包含LocalDateTime类型字段的模型对象。DTO包含Instant类型字段。我想将LocalDateTime类型字段映射到Instant类型字段。我有传入请求的TimeZone实例。
像这样手动设置字段;
set( LocalDateTime.ofInstant(x.getStartDate(), timeZone.toZoneId()) )
Run Code Online (Sandbox Code Playgroud)
如何使用Mapstruct映射这些字段?
datetime-conversion java-time mapstruct localdate java.time.instant