package com.hfkj.sysenum.order;

import java.util.Objects;

/**
 * @className: OrderChildProductType
 * @author: HuRui
 * @date: 2024/4/30
 **/
public enum OrderChildProductTypeEnum {
    /**
     * 产品
     */
    type1(1, "实物产品"),
    type2(2, "虚拟产品"),
    type3(3, "千猪电影票"),
    type4(4, "千猪星巴克"),
    ;

    private int code;

    private String name;


    OrderChildProductTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OrderChildProductTypeEnum getData(Integer type) {
        for (OrderChildProductTypeEnum ele : values()) {
            if(Objects.equals(type,ele.getCode())) return ele;
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
