Commit 119139c671e1c803f1a7a0ff0afad341de8d6c35
1 parent
d0bc8ee9
跟进池接口调整
Showing
1 changed file
with
0 additions
and
30 deletions
fw-valhalla-server/src/main/java/cn/fw/valhalla/converter/Timestamp2LocalDateConverter.java deleted
1 | -package cn.fw.valhalla.converter; | ||
2 | - | ||
3 | -import org.apache.commons.lang3.StringUtils; | ||
4 | -import org.apache.commons.lang3.math.NumberUtils; | ||
5 | -import org.springframework.boot.context.properties.ConfigurationPropertiesBinding; | ||
6 | -import org.springframework.core.convert.converter.Converter; | ||
7 | -import org.springframework.lang.Nullable; | ||
8 | -import org.springframework.stereotype.Component; | ||
9 | - | ||
10 | -import java.time.Instant; | ||
11 | -import java.time.LocalDate; | ||
12 | -import java.time.ZoneId; | ||
13 | - | ||
14 | -/** | ||
15 | - * create at 2020-10-19 | ||
16 | - * | ||
17 | - * @author kurisu | ||
18 | - */ | ||
19 | -@Component | ||
20 | -@ConfigurationPropertiesBinding | ||
21 | -public class Timestamp2LocalDateConverter implements Converter<String, LocalDate> { | ||
22 | - @Override | ||
23 | - @Nullable | ||
24 | - public LocalDate convert(@Nullable final String value) { | ||
25 | - if (StringUtils.isNotBlank(value) && NumberUtils.isDigits(value)) { | ||
26 | - return Instant.ofEpochMilli(NumberUtils.toLong(value)).atZone(ZoneId.systemDefault()).toLocalDate(); | ||
27 | - } | ||
28 | - return null; | ||
29 | - } | ||
30 | -} |