package com.yanzhu.module.promotion.job.coupon;

import cn.hutool.core.util.StrUtil;
import com.yanzhu.framework.quartz.core.handler.JobHandler;
import com.yanzhu.framework.tenant.core.job.TenantJob;
import com.yanzhu.module.promotion.service.coupon.CouponService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 优惠券过期 Job
 *
 * @author owen
 */
@Component
public class CouponExpireJob implements JobHandler {

    @Resource
    private CouponService couponService;

    @Override
    @TenantJob
    public String execute(String param) {
        int count = couponService.expireCoupon();
        return StrUtil.format("过期优惠券 {} 个", count);
    }

}
