代码调整
This commit is contained in:
parent
2cf13503e7
commit
d965607ab7
@ -10,6 +10,7 @@ import com.alibaba.fastjson2.writer.ObjectWriter;
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
@ -47,6 +48,9 @@ public class JsonConfig implements ApplicationRunner {
|
||||
public LocalDateTime readObject(JSONReader jsonReader, Type fieldType, Object fieldName,
|
||||
long features) {
|
||||
String str = jsonReader.readString();
|
||||
if (StringUtils.isEmpty(str)) {
|
||||
return null;
|
||||
}
|
||||
return LocalDateTime.parse(str, DATE_TIME_FORMATTER);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user