package com.gyee.wisdom.alarm.sharding.config;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;
import com.alibaba.fastjson.serializer.SerializeWriter;

import java.io.IOException;
import java.lang.reflect.Type;

/**
 * @description:
 * @auther: Wanghs
 * @date: 2022-06-01
 */
public class MyStringSerializer implements ObjectSerializer {
    public static final MyStringSerializer instance = new MyStringSerializer();
    @Override
    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
        SerializeWriter out = serializer.getWriter();
        out.write(object.toString());
    }
}
