backend-api LocalTime meta parsing fix
This commit is contained in:
parent
b6c25744d2
commit
292675e92b
1 changed files with 4 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
|
@ -17,6 +18,7 @@ import java.util.stream.Collectors;
|
|||
public class GetResponseFactory {
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
private final MetaServer meta;
|
||||
private static final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
|
||||
|
||||
@Autowired
|
||||
public GetResponseFactory(MetaServer meta) {
|
||||
|
|
@ -71,6 +73,8 @@ public class GetResponseFactory {
|
|||
data = sdf.format(value);
|
||||
} else if (value instanceof Instant) {
|
||||
data = dateTimeFormatter.format((Instant) value);
|
||||
} else if (value instanceof LocalTime) {
|
||||
data = timeFormatter.format((LocalTime) value);
|
||||
} else {
|
||||
data = value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue