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

com.doyospy.core.helper.IdSerializer Maven / Gradle / Ivy

Go to download

Doyospy是一个小而全的基于SpringBoot的java工具类库,通过静态方法封装,方便开发者使用,降低学习成本并提升工作效率。

The newest version!
package com.doyospy.core.helper;

import com.doyospy.core.util.IdUtil;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;

/**
 * ID序列化
 * @author  Robin
 */
public class IdSerializer extends JsonSerializer {
    @Override
    public void serialize(Long value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        gen.writeString(IdUtil.encode(value));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy