package org.wcs.constant.enums.database;

import lombok.Getter;

import java.util.List;

/**
 * 电子标签种类
 */
@Getter
public enum ETagTypeEnum {

    NUMBER_BUTTON_3(1, "3位数字带按钮"),
    NUMBER_BUTTON_7(2, "7位数字带按钮"),
    SCAN(3, "扫描枪"),
    LIGHT(4, "单色灯"),
    NUMBER_ENGLISH_BUTTON_12(5, "12位数字英文带按钮"),
    NUMBER_CHINESE_BUTTON_6(6, "6位数字中文带按钮");

    private final Integer code;
    private final String desc;

    ETagTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ETagTypeEnum getByCode(Integer code) {
        for (ETagTypeEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

    /**
     * 按钮标签列表
     * @return 按钮标签列表
     */
    public static List<ETagTypeEnum> buttonTagList() {
        return List.of(NUMBER_BUTTON_3, NUMBER_BUTTON_7, NUMBER_ENGLISH_BUTTON_12, NUMBER_CHINESE_BUTTON_6);
    }

}
