package com.hfkj.sysenum.agent;

import lombok.Getter;

import java.util.Objects;

/**
 * @className: AgentTypeEnum
 * @author: HuRui
 * @date: 2024/8/27
 **/
@Getter
public enum AgentStatusEnum {
    /**
     * 删除
     */
    status0(0 , "删除"),
    /**
     * 正常
     */
    status1(1 , "正常"),
    /**
     * 禁用
     */
    status2(2 , "禁用"),
    ;

    private Integer code;

    private String name;

    AgentStatusEnum(int code , String name) {
        this.code = code;
        this.name = name;
    }

    public static AgentStatusEnum getDataByType(Integer type) {
        for (AgentStatusEnum ele : values()) {
            if(Objects.equals(type,ele.code)) return ele;
        }
        return null;
    }
}
