You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
814 B
Java

2 years ago
package com.xydl.util;
import com.xydl.service.impl.MqttServiceImpl;
2 years ago
import lombok.extern.slf4j.Slf4j;
2 years ago
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
2 years ago
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
2 years ago
2 years ago
import javax.annotation.PostConstruct;
2 years ago
import java.text.SimpleDateFormat;
import java.util.Date;
2 years ago
@Component
@Slf4j
2 years ago
public class Subscribe {
2 years ago
@Autowired
MqttUtil mqttUtil;
2 years ago
2 years ago
private static Subscribe single = new Subscribe();
2 years ago
@PostConstruct
private void SubscribeMqtt() {
2 years ago
// log.info("开始订阅===subScribe执行一次==={}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
2 years ago
// mqttUtil.subScribeMQTT();
2 years ago
}
public static Subscribe getInstance() {
2 years ago
return single;
}
}