修复依赖注入的问题

This commit is contained in:
孙小云 2026-02-26 13:37:41 +08:00
parent f62d2798f6
commit b4809cf94d
1 changed files with 8 additions and 2 deletions

View File

@ -66,6 +66,12 @@ public class TuohengService {
@Autowired @Autowired
private MqttCallbackRegistry mqttCallbackRegistry; private MqttCallbackRegistry mqttCallbackRegistry;
@Autowired
private FlightEventCallback flightEventCallback;
@Autowired
private FlightLogCallback flightLogCallback;
private final ObjectMapper objectMapper = new ObjectMapper(); private final ObjectMapper objectMapper = new ObjectMapper();
/** /**
@ -183,9 +189,9 @@ public class TuohengService {
} }
}); });
handler.registerDroneRealTimeCallback(new FlightLogCallback()); handler.registerDroneRealTimeCallback(flightLogCallback);
handler.registerAirportFlyControlDataCallback(new FlightEventCallback()); handler.registerAirportFlyControlDataCallback(flightEventCallback);
log.info("TuohengService 初始化完成,已注册所有回调"); log.info("TuohengService 初始化完成,已注册所有回调");
} }