package com.gic.haoban.manage.api.enums;

/**
 * Created 2021/6/17.
 *
 * @author hua
 */
public enum QuartzEnum {
    /**
     * 企业微信
     */
    HANDOVER_QYWX("handover", "com.gic.haoban.manage.api.service.HandoverOperationApiService", "batchQywxHandoverTimeTask", "0 0 0 * * *", "-1"),
    TAG_QYWX("qywxTagCheck", "com.gic.haoban.manage.api.service.QywxTagApiService", "checkQywxSync", "0 30 10 * * *", "-1"),
    /**
     * 话务任务逾期提醒
     */
    TEL_TASK_LATE_REMIND("telTaskLateRemind", "com.gic.haoban.task.manage.api.service.ITelTaskCallApiService", "telTaskLateRemind", "0 0 15 * * *", "-1"),
    TEL_TASK_INVALID_REMIND("telTaskInvalidRemind", "com.gic.haoban.task.manage.api.service.ITelTaskCallApiService", "telTaskInvalidRemind", "0 0 15 * * *", "-1");
    private String key;
    private String serviceName;
    private String method;
    private String cron;
    private String params;

    QuartzEnum(String key, String serviceName, String method, String cron, String params) {
        this.key = key;
        this.serviceName = serviceName;
        this.method = method;
        this.cron = cron;
        this.params = params;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public static QuartzEnum getByKey(String key) {
        if (key == null) {
            return null;
        }
        QuartzEnum[] values = QuartzEnum.values();
        for (QuartzEnum value : values) {
            if (value.getKey().equals(key)) {
                return value;
            }
        }
        return null;
    }
}
