1
0

AliyunSmsTask.java 678 B

1234567891011121314151617181920212223242526
  1. package com.kmall.admin.task;
  2. import com.kmall.admin.service.aliyunsms.SendSmsRecordService;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.scheduling.annotation.Scheduled;
  5. import org.springframework.stereotype.Component;
  6. /**
  7. * 阿里云短信定时任务
  8. *
  9. * @author zhuhh
  10. * @date 2021-12-9 11:37:26
  11. */
  12. @Component
  13. public class AliyunSmsTask {
  14. @Autowired
  15. private SendSmsRecordService sendSmsRecordService;
  16. /**
  17. * 定时扫描 send_sms_record 表的发送失败短信并重新发送
  18. */
  19. @Scheduled(fixedRate = 10000)
  20. public void reSendFailMsg() {
  21. sendSmsRecordService.reSendFailMsg();
  22. }
  23. }