package com.cm.manager.sms.task;

import com.cm.manager.sms.manager.VerificationCodeManager;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: VerificationCodeTask
 * @Description: 验证码任务
 * @Author: WangGeng
 * @Date: 2020/3/4 7:56 下午
 * @Version: 1.0
 **/
@Configuration
@EnableScheduling
public class SmsTask {

    /**
     * 清除过期验证码任务
     */
    @Scheduled(cron = "30 * * * * ?")
    public void verificationCodeExpireTimeClearTask() {
        VerificationCodeManager.getInstance().clearExpireTimeCode();
    }

}
