package org.dromara.payment.timer;

import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.dromara.payment.merchant.mapper.BusMerchantProductMapper;
import org.dromara.payment.merchant.service.IBusMerchantProductService;
import org.springframework.stereotype.Component;
import tech.powerjob.worker.core.processor.ProcessResult;
import tech.powerjob.worker.core.processor.TaskContext;
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;

import javax.annotation.Resource;

/**
 * @author sunzexing
 * @version 1.0
 * @title MerchantProductJob
 * @description 商户产品费率修改定时任务
 * @create 2024-05-06 19:10
 */
@Component
@Slf4j
public class MerchantProductJob implements BasicProcessor {

    @Resource
    private BusMerchantProductMapper  busMerchantProductMapper;

    @XxlJob("merchantProductProcessJob")
    public ProcessResult process(TaskContext taskContext) throws Exception {

        this.busMerchantProductMapper.updateMerProInfosService();
        log.info("商户产品费率修改定时任务执行成功");
        return new ProcessResult(true);
    }
}

