package com.hfkj.sysenum.agent;

import com.hfkj.sysenum.DeviceTypeEnum;
import lombok.Getter;

import java.util.Objects;

/**
 * @className: AgentTypeEnum
 * @author: HuRui
 * @date: 2024/8/27
 **/
@Getter
public enum AgentTypeEnum {
    /**
     * 地推代理
     */
    type1(1 , "地推代理"),
    /**
     * API代理
     */
    type2(2 , "API代理"),
    /**
     * 推广代理
     */
    type3(3 , "推广代理"),
    ;

    private Integer code;

    private String name;

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

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