package com.brilliance.isc.common.taskdistributor.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserPosition {

    HANDLER("handler","经办","1"),
    REVIEWE("reviewer","复核","2"),
    MANAGER("supervisor","主管","3");

    private final String value;
    private final String name;
    //优先级
    private final String priority;

    //获取name
    public static String getValueName(String code) {
        for (UserPosition value : UserPosition.values()) {
            if (value.value.equals(code)) {
                return value.name;
            }
        }
        return null;
    }

    //获取优先级
    public static String getValuePriority(String code) {
        for (UserPosition value : UserPosition.values()) {
            if (value.value.equals(code)) {
                return value.priority;
            }
        }
        return null;
    }
}
