package com.mmc.iuav.user.util;

import com.mmc.iuav.user.entity.UserDO;
import com.mmc.iuav.user.service.WxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.TimerTask;

@Component
public class MyTask extends TimerTask implements Serializable {

    private UserDO userDO;

//    private WxService wxService;

    public void setUserDO(UserDO userDO) {
        this.userDO = userDO;
    }
//    public void setWxService(WxService wxService) {
//        this.wxService = wxService;
//    }

    private static final long serialVersionUID = 1L;

    @Override
    public void run() {
        SmsUtil.sendNewMessage(userDO.getPhoneNum());
        System.out.println("定时任务执行完毕！");
    }
}

