package com.usky.transfer.service.mqtt.alarm;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.usky.common.core.util.JsonUtils;
import com.usky.transfer.domain.DeviceDataWriteVO;
import com.usky.transfer.service.QueryInfluxdbDataService;
import com.usky.transfer.service.mqtt.MqttStrategy;
import com.usky.transfer.service.rocketmq.MyProducer;
import com.usky.transfer.service.utils.HttpClientUtils;
import com.usky.transfer.service.vo.MqttBaseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author zyj
 * @date 2025/1/13 15:07
 */
@Service("alarm")
public class alarm implements MqttStrategy {
    @Value("${alarm.url}")
    private String alarmUrl;

    public String disposeMessage(MqttBaseVO mqttBaseVO) {
        String data = mqttBaseVO.getData().toString();
        JSONObject jsonObject = JSONObject.parseObject(data);
        String resultString = HttpClientUtils.doPostJson(alarmUrl,jsonObject.toJSONString());

        System.out.println("resultString: "+resultString);

        return null;
    }


}
