package cn.com.ctop.check.component.basic;

import cn.com.ctop.check.entity.CtopCheckTaskList;
import cn.com.ctop.notice.handler.SendWeChatHandle;
import org.springframework.context.ApplicationContext;

import java.text.SimpleDateFormat;
import java.util.Date;

public abstract class AbstractScript implements BaseScript{

    protected ApplicationContext applicationContext;

    protected CtopCheckTaskList ctopCheckTaskList;

    protected SendWeChatHandle sendWeChatHandle;

    protected String todayDate;

    public ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    public CtopCheckTaskList getCtopCheckTaskList() { return ctopCheckTaskList; }

    public void setCtopCheckTaskList(CtopCheckTaskList ctopCheckTaskList) {
        this.ctopCheckTaskList = ctopCheckTaskList;
    }

    public SendWeChatHandle getSendWeChatHandle() {
        return sendWeChatHandle;
    }

    public void setSendWeChatHandle(SendWeChatHandle sendWeChatHandle) {
        this.sendWeChatHandle = sendWeChatHandle;
    }


    public String getTodayDate() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        return format.format(new Date());
    }

}
