1.监督计划功能调整
2.全过程功能调整
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.njcn.harmonic.utils;
|
||||
|
||||
import com.alibaba.fastjson.serializer.JSONSerializer;
|
||||
import com.alibaba.fastjson.serializer.ObjectSerializer;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
@Component
|
||||
public class TimestampAsLongSerializer implements ObjectSerializer {
|
||||
|
||||
@Override
|
||||
public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
|
||||
if (object instanceof Timestamp) {
|
||||
Timestamp timestamp = (Timestamp) object;
|
||||
// 将Timestamp转换为时间戳(毫秒数)
|
||||
long time = timestamp.getTime();
|
||||
serializer.write(time);
|
||||
} else {
|
||||
serializer.write(object);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user