package com.shanghaichengdi.schedule; import com.shanghaichengdi.service.IBoatPollutionWarningService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; /** * @ClassName PollutionWarningSchedule * @Author Tevin * @DATE 2024/12/24 10:50 * @Description TODO **/ @Component public class PollutionWarningSchedule { @Resource private IBoatPollutionWarningService boatPollutionWarningService; @Scheduled(fixedRate = 10 * 60 * 1000) public void ShortBarge() { boatPollutionWarningService.handleShortBarge(); } @Scheduled(fixedRate = 10 * 60 * 1000) public void OrdinaryShip() { boatPollutionWarningService.handleOrdinaryShip(); } }