|
@@ -13,7 +13,9 @@ import com.coffee.bus.listener.event.bean.DeviceInfoEvent;
|
|
|
import com.coffee.bus.service.LocalBusDeviceService;
|
|
import com.coffee.bus.service.LocalBusDeviceService;
|
|
|
import com.coffee.bus.service.LocalBusInfusionHistoryService;
|
|
import com.coffee.bus.service.LocalBusInfusionHistoryService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
@@ -36,23 +38,17 @@ import java.util.concurrent.TimeUnit;
|
|
|
@Service
|
|
@Service
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class AliyunConsumerGroupService {
|
|
public class AliyunConsumerGroupService {
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ @Lazy
|
|
|
|
|
+ private AliyunIotSubscribeClient client;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ @Lazy
|
|
|
|
|
+ private LocalBusDeviceService deviceService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ @Lazy
|
|
|
|
|
+ private LocalBusInfusionHistoryService infusionHistoryService;
|
|
|
|
|
|
|
|
- // 初始化订阅客户端
|
|
|
|
|
- private final AliyunIotSubscribeClient client;
|
|
|
|
|
|
|
|
|
|
- // 设备Service
|
|
|
|
|
- private final LocalBusDeviceService deviceService;
|
|
|
|
|
-
|
|
|
|
|
- // 输注Service
|
|
|
|
|
- private final LocalBusInfusionHistoryService infusionHistoryService;
|
|
|
|
|
-
|
|
|
|
|
- public AliyunConsumerGroupService(AliyunIotSubscribeClient client,
|
|
|
|
|
- LocalBusDeviceService deviceService,
|
|
|
|
|
- LocalBusInfusionHistoryService infusionHistoryService) {
|
|
|
|
|
- this.client = client;
|
|
|
|
|
- this.deviceService = deviceService;
|
|
|
|
|
- this.infusionHistoryService = infusionHistoryService;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
@Value("${aliyun.server-subscription.enable:false}")
|
|
@Value("${aliyun.server-subscription.enable:false}")
|
|
|
private boolean isEnable;
|
|
private boolean isEnable;
|