package com.tzld.piaoquan.api.common.enums.wecom;

import lombok.Getter;

@Getter
public enum ThirdPartWeComStaffStatusEnum {
    
    NORMAL(0, "正常"),
    OFFLINE(1, "掉线"),
    QUIT(2, "离线"),

    other(999, "其他");

    // 0正常，1掉线，2离线
    private final int val;
    private final String description;

    ThirdPartWeComStaffStatusEnum(int val, String description) {
        this.val = val;
        this.description = description;
    }

    public static ThirdPartWeComStaffStatusEnum from(int val) {
        for (ThirdPartWeComStaffStatusEnum statusEnum : ThirdPartWeComStaffStatusEnum.values()) {
            if (statusEnum.getVal() == val) {
                return statusEnum;
            }
        }

        return other;
    }


}
