package com.tofly.mq.config;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @author tuonbed
 * @date 2020/6/2  17:34
 */
public class KafkaMsgtoPojo {

    public static <T> T getMsgtoPojo(String msg,Class<T> tClass){
        JSONObject jsonObject = JSON.parseObject(msg);
        T t = jsonObject.toJavaObject(tClass);
        return t;
    }
}
