package cn.com.ctop.job.bytedance.handler;

import cn.com.ctop.common.module.utils.HttpUtils;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.jeecg.common.util.DateUtils;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class BytedanceAiCreateJob {
    private static final String URLPREFIX = "http://118.24.244.213:8808/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/autoCreateCreative?hour=";
//    private static final String URLPREFIX = "http://gateway.bjhcstszkj.cn/advertiser/aiBytedanceAdvertiserStrategy/autoCreateCreative?hour=";
    /**
     * 头条自动投放创建任务
     * @throws Exception
     */
    @XxlJob("bytedanceAutoCreateJob")
    public void execute() throws Exception {
        String hour = DateUtils.getNowHour(new Date());
        HttpUtils.httpGet(URLPREFIX + hour, null, null);
    }
}
