| 123456789101112131415161718192021222324 |
- package com.persagy.fm.common.serializer;
- import com.fasterxml.jackson.core.JsonParser;
- import com.fasterxml.jackson.core.JsonProcessingException;
- import com.fasterxml.jackson.databind.DeserializationContext;
- import com.fasterxml.jackson.databind.JsonDeserializer;
- import com.persagy.fm.common.lang.PsTime;
- import org.springframework.boot.jackson.JsonComponent;
- import java.io.IOException;
- /**
- * @Description 时间反序列化
- * @author Charlie Yu
- * @version 1.0 2021-04-08
- */
- @JsonComponent
- public class PsTimeDeserializer extends JsonDeserializer<PsTime> {
- @Override
- public PsTime deserialize(JsonParser p, DeserializationContext context) throws IOException, JsonProcessingException {
- return PsTime.parsePsTime(p.getLongValue());
- }
- }
|