自定义组件代码bug解决

This commit is contained in:
2022-09-13 14:39:32 +08:00
parent 56182aa79c
commit da281bfde5
11 changed files with 93 additions and 28 deletions

View File

@@ -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;
}