package com.yunfeiyun.agmp.common.enums;

/**
 * 农事任务类型
 * */
public enum TaskType {
    PICK("-1", "采收"),
    PATROL("-2", "巡田"),
    ;
    private final String code;
    private final String message;

    TaskType(String code, String message)
    {
        this.code = code;
        this.message = message;
    }

    public String getCode()
    {
        return code;
    }

    public String getMessage()
    {
        return message;
    }

    public boolean equal(String code){
        return this.code.equals(code);
    }

    public static String valueOfCode(String code){
        for(TaskType taskType: TaskType.values()) {
            if(taskType.equal(code)){
                return taskType.getMessage();
            }
        }
        return "";
    }
}
