自定义组件代码bug解决
This commit is contained in:
@@ -334,6 +334,17 @@ public class InfluxDBResultMapperCn {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (LocalDateTime.class.isAssignableFrom(fieldType)) {
|
||||
LocalDateTime localDateTime;
|
||||
if (value instanceof String) {
|
||||
localDateTime = LocalDateTime.ofInstant(Instant.from(DateTimeFormatter.ISO_DATE_TIME.parse(String.valueOf(value))), ZoneId.systemDefault());
|
||||
} else {
|
||||
throw new InfluxDBMapperException("Unsupported type " + field.getClass() + " for field " + field.getName());
|
||||
}
|
||||
field.set(object, localDateTime);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user