package org.springblade.modules.app.common.enums;

public enum UserTypeEnum {

    SLAUGHTER(1, "屠宰场"),
    FARM(2, "养殖场"),
    DRIVER(3, "司机"),
    AGENT(4, "经纪人"),
    SLAUGHTER_HOUSE(5, "屠宰户"),
    ANIMAL_BUREAU(6, "畜牧局"),
    ;
    private int code;
    private String text;

    UserTypeEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static UserTypeEnum findByCode(int code) {
        for (UserTypeEnum demoEnum : values()) {
            if (code == demoEnum.getCode()) {
                return demoEnum;
            }
        }
        return null;
    }

}
