package cn.com.countrygarden.bi.main.util.entity;

import cn.com.countrygarden.bi.main.util.DateUtil;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.util.Date;

/**
 * <pre>
 *  该类可以将Long转换成String类型
 * </pre>
 *  
 * @author ferren  liao-r@neusoft.com
 * @version 1.00.00
 * <p>
 * <p>
 * <pre>
 * 修改记录
 *    修改后版本:     修改人：  修改日期:     修改内容:
 * </pre>
 */
public class DateToStringSerializerJackJson extends JsonSerializer<Date> {

    @Override
    public void serialize(Date object, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeString(DateUtil.simpleFormat(object));
    }


}
