package com.njzscloud.supervisory.config;

import cn.hutool.extra.spring.SpringUtil;
import com.njzscloud.supervisory.biz.service.TruckLocationTrackService;
import com.njzscloud.supervisory.device.service.DeviceLocalizerService;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class SpringReady {

    @EventListener(ApplicationReadyEvent.class)
    public void onApplicationReady() {
        SpringUtil.getBean(DeviceLocalizerService.class).onApplicationReady();
        SpringUtil.getBean(TruckLocationTrackService.class).onApplicationReady();
    }
}
