package cn.iocoder.yudao.module.job.job;

import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class FileWarnJob implements JobHandler {

    private final IInspectionFileService inspectionFileService;

    /**
     * 执行任务
     *
     * @param param 参数
     * @return 结果
     * @throws Exception 异常
     */
    @Override
    @TenantJob
    public String execute(String param) throws Exception {
        inspectionFileService.warnReminder();
        log.info("执行了文件提醒");
        return String.format("定时执行清理定时任务日志数量 %s 个");
    }
}
