package com.yeejoin.amos.patrol.core.common.request;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.fasterxml.jackson.databind.module.SimpleModule;

/**
 * @description:
 * @author: tw
 * @createDate: 2023/4/13
 */
public class ToJson {


    public  static Object tojson(Object obj) {
        Object ob=null;
        if(obj!=null){
            SerializeConfig serializeConfig = new SerializeConfig();
            serializeConfig.put(Long.class, ToStringSerializer.instance);
            serializeConfig.put(Long.TYPE, ToStringSerializer.instance);
            String json = JSONObject
                    .toJSONString(obj, serializeConfig,
                            SerializerFeature.PrettyFormat);
            ob=JSONObject.parse(json);
        }
        return  ob;
    }
}
