package cn.cecep.talroad.task;

import cn.cecep.talroad.common.core.web.controller.BaseController;
import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.service.IPcFactoryService;
import cn.cecep.talroad.service.STaskYieldTrendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zpz
 * @Date: 2023-4-9 14:39:52
 * @Version 1.0
 */
@Api(tags = "企业定时任务")
@RestController
@RequestMapping("/factory")
@Slf4j
public class FactoryScheduledController extends BaseController {

    @Autowired
    private IPcFactoryService pcFactoryService;

    /**
     * 定时更新 企业与接入数据类型关联表 每十天凌晨1点
     */
//    @Scheduled(cron = "0/30 * * * * ?") // 每十天凌晨1点
//    @PostConstruct

    @GetMapping("/timingUpdateAdslFactory")
    public void timingUpdateAdslFactory() {
        try {
            pcFactoryService.timingUpdateAdslFactory();
        } catch (Exception e) {
            e.printStackTrace();
            log.info("定时更新企业与接入数据类型关联表数据失败. 原因：" + e.getMessage());
        }
    }
}
