package com.hzs.common.core.enums;

import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Description: 基础业务办理-按钮类型枚举
 * Author: zhangjing
 * Time: 2022/9/1 9:06
 * Classname: EButtonType
 * PackageName: com.hzs.common.core.enums
 */
@AllArgsConstructor
@Getter
public enum EButtonType {

    /**
     * 1=单选按钮
     */
    SINGLE_CHOICE(1, "单选按钮", 0, EnumsPrefixConstants.EBUTTON_TYPE + "1"),
    /**
     * 2=多选按钮
     */
    MULTIPLE_CHOICE(2, "多选按钮", 0, EnumsPrefixConstants.EBUTTON_TYPE + "2"),
    /**
     * 3=输入框
     */
    IMPORT(3, "输入框", 0, EnumsPrefixConstants.EBUTTON_TYPE + "3"),



    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;
    /**
     * 是否启用（0=是,1=否） -- 来源EYesNo
     */
    private final int enable;
    /**
     * 国际化翻译key值
     */
    private final String key;


    /**
     * 根据枚举值获取枚举
     *
     * @param value 枚举值
     * @return
     */
    public static EButtonType getEnumByValue(int value) {
        for (EButtonType eApproveStatus : EButtonType.values()) {
            if (eApproveStatus.getValue() == value) {
                return eApproveStatus;
            }
        }
        return null;
    }

}
