package com.hfkj.sysenum.discount;

import java.util.Objects;

/**
 * 优惠券包code状态
 * @author hurui
 */
public enum DiscountPkStockCodeStatusEnum {
    status0(0 , "删除"),
    status1(1 , "未领取"),
    status2(2 , "已领取"),
    ;

    private Integer code;
    private String name;

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

    public static String getNameByType(Integer code) {
        for (DiscountPkStockCodeStatusEnum ele : values()) {
            if(Objects.equals(code,ele.getCode())) return ele.getName();
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

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

    public String getName() {
        return name;
    }

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