package org.jeecg.modules.ctop.job;

import cn.com.ctop.crawler.modules.account.entity.KuaishouAdAccount;
import cn.com.ctop.crawler.modules.account.service.IKuaishouAdAccountService;
import cn.com.ctop.kuaishou.modules.app.service.IKuaishouAppService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class KuaishouAdvertiserCrawlerJob implements Job {
    @Autowired
    private IKuaishouAdAccountService kuaishouAdAccountService;
    @Autowired
    private IKuaishouAppService kuaishouAppService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        List<KuaishouAdAccount> list = kuaishouAdAccountService.querySyncAccount();
        if (list != null) {
            for (KuaishouAdAccount account : list) {
                kuaishouAppService.adAccountFetch(account, "");
            }
        }
    }
}
