package com.hzs.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商品类型枚举
 */
@AllArgsConstructor
@Getter
public enum EWaresType {

    /**
     * 1=普通商品
     */
    ORDINARY(1, "普通商品"),

    /**
     * 2=188商品
     */
    PRODUCT_188(2, "188商品"),

    ;

    /**
     * 实际值
     */
    private final Integer value;

    /**
     * 显示标签
     */
    private final String label;

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