All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mizhousoft.weixin.mp.domain.serializer.NumericDateDeserializer Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package com.mizhousoft.weixin.mp.domain.serializer;

import java.io.IOException;
import java.time.LocalDateTime;

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.mizhousoft.commons.lang.LocalDateTimeUtils;

/**
 * 反序列化
 *
 */
public class NumericDateDeserializer extends JsonDeserializer
{
	@Override
	public LocalDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException
	{
		long ts = parser.getLongValue();
		return LocalDateTimeUtils.toLocalDateTime(ts);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy