package com.ruoyi.cai.job;

import com.ruoyi.cai.service.DynamicService;
import com.ruoyi.cai.service.SmsVerifyService;
import com.ruoyi.cai.service.UserChatRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ClearDaysJob {

    @Autowired
    private SmsVerifyService smsVerifyService;


    // 凌晨8点执行
    @Scheduled(cron = "0 0 8 * * ? ")
    public void clearRun() {
        try {
            log.info("定时删除短信记录== 开始");
            smsVerifyService.clearSmsVerify(7);
            log.info("定时删除短信记录== 结束");
        }catch (Exception e){
            log.error("定时删除短信记录== 异常",e);
        }

    }
}
