package cn.iocoder.yudao.module.iot.framework.mqtt.utils;

import cn.iocoder.yudao.module.iot.framework.mqtt.entity.MqttData;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MqttDataUtils {

    public static MqttData parse(String entity) {
        try {
            MqttData data = JSON.parseObject(entity, MqttData.class);
            return data;
        } catch (Exception e) {
            e.printStackTrace();
            log.error("MqttDataHandler.JSON.parseObject error:");
        }
        return null;
    }
}
