package com.cyl.job;

import com.cyl.h5.service.H5MemberCouponService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class CouponJob {

    @Autowired
    private H5MemberCouponService h5MemberCouponService;


    @Async
    @Scheduled(cron = "00 0/5 * * * ?")
    public void cancelOrder(){
        log.info("【优惠券过期处理任务启动】");

        h5MemberCouponService.processExpiredCoupon();

        log.info("【优惠券过期处理任务结束】");
    }

}
