package com.ruoyi.other.task; import com.ruoyi.other.service.TExchangeCodePackageService; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; @Component public class ExchangeCodeExpireTask { @Resource private TExchangeCodePackageService exchangeCodePackageService; @Scheduled(cron = "0 */5 * * * ?") public void refreshExpiredPackageCodes() { exchangeCodePackageService.refreshExpiredPackageCodes(); } }