package com.xzx.gc.shop.job;
|
|
import com.xzx.gc.shop.service.OrderService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
|
@EnableAsync
|
@Slf4j
|
@Component
|
public class ShopJob {
|
|
@Resource
|
private OrderService orderService;
|
/**
|
时间是每天变动一次
|
自动售货
|
*/
|
@Scheduled(cron = "0 0 23 * * ?")
|
public void changeOrderStatue() {
|
orderService.changeOrderStatue();
|
}
|
|
public static void main(String[] args) {
|
|
}
|
}
|