| | |
| | | |
| | | import com.xiaopeng.api.model.operation.XpBanner; |
| | | import com.xiaopeng.operation.service.XpBannerService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * @author 无关风月 |
| | | * @date 2026/2/26 9:49 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class BannerTaskUtil { |
| | | |
| | |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskMinute() { |
| | | try { |
| | | log.info("处理的banner状态定时任务开始执行,当前时间:{}", LocalDateTime.now()); |
| | | // 根据banner开始、结束时间修改banner状态 |
| | | List<XpBanner> banners = bannerService.list(); |
| | | for (XpBanner banner : banners) { |