package com.yida.data.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商品类别
 */
@Getter
@AllArgsConstructor
public enum ProductType {
    // 服务类商品
    SERVICE(0,"服务类商品"),
    // 实物商品
    PHYSICAL(1,"实体商品"),
    //应用商品
    APPLY(2,"应用商品");
    private Integer value;
    private String name;

    public static ProductType getType(Integer value) {
        for (ProductType productType : ProductType.values()) {
            if (productType.getValue().equals(value)) {
                return productType;
            }
        }
        return null;
    }
}
