package com.hai.enum_type;

import java.util.Objects;

/**
 * 产品图片
 * @author hurui
 */
public enum OrderLogoEnum {
    name1("orderLogo/coupon.png", 1),
    name3("orderLogo/refuel.png", 3),
    name4("orderLogo/kfc.png", 4),
    name9("orderLogo/starbucks.png", 9),
    name10("orderLogo/member-recharge.png", 10),
    name20("orderLogo/call-charges.png", 20),
    ;


    private String imgUrl;

    private Integer type;
    public static String getNameByImgUrl(Integer type) {
        for (OrderLogoEnum ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele.getImgUrl();
        }
        return null;
    }

    OrderLogoEnum(String imgUrl, Integer type) {
        this.imgUrl = imgUrl;
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }
}
