package com.hai.enum_type;

import java.util.Objects;

/**
 * 优惠券平台类型
 */
public enum DiscountPlatform {
    HSG(1, "HSG", "嗨森逛"),
    GRATIA_PAY(2, "GRATIA_PAY","惠支付"),
    ;

    private Integer number;

    private String code;

    private String name;

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

    public static DiscountPlatform getPlatformByCode(String code) {
        for (DiscountPlatform ele : values()) {
            if(Objects.equals(code,ele.getCode())) return ele;
        }
        return null;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

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

    public String getCode() {
        return code;
    }

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