package com.yida.data.job.task;


import com.yida.data.school.feign.transaction.RemoteProductService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author ccl
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class ProductUpdateTask {

    private final RemoteProductService remoteProductService;

    public void productUpdate(String id) {
        log.info("执行更新商品定时任务,id:[{}]", id);
        remoteProductService.upDateProductById(Long.valueOf(id));
    }

    public void productSendNotice(String id) {
        log.info("执行商品催缴定时任务,id:[{}]", id);
        remoteProductService.productSendNotice(Long.valueOf(id));
    }


    /**
     * 监测商品是否失效任务
     *
     * @param
     */
    public void productMonitor() {
        log.info("执行更新商品定时任务,id:[{}]");
        remoteProductService.productMonitor();
    }

}
