package com.hai.order.type;

import java.util.Objects;

/**
 * 订单产品类型
 * @className: OrderProductType
 * @author: HuRui
 * @date: 2022/8/25
 **/
public enum OrderProductType {
    PRODUCT_TYPE1(1, "星巴克","orderLogo/starbucks.png", "STARBUCKS_CONFIG"),
    PRODUCT_TYPE2(2, "肯德基", "orderLogo/kfc.png" , "KFC_CONFIG"),
    PRODUCT_TYPE3(3, "第三方充值", "orderLogo/member-top-up.png" , "MEMBER_RECHARGE_CONFIG"),
    PRODUCT_TYPE4(4, "积分充值", "orderLogo/integral-top-up.png" , "INTEGRAL_RECHARGE_CONFIG"),
    PRODUCT_TYPE5(5, "购买卡券", "orderLogo/coupon.png", "COUPON_CONFIG"),
    PRODUCT_TYPE6(6, "在线加油" , "orderLogo/refuel-online.png", "REFUEL_ONLINE_CONFIG"),
    PRODUCT_TYPE7(7, "优惠券包", "orderLogo/coupon-packs.png", "COUPON_PACKS_CONFIG"),
    PRODUCT_TYPE8(8, "汇联通工会卡充值", "orderLogo/hlt.png", "HLT_CONFIG"),
    PRODUCT_TYPE9(9, "话费充值" , "orderLogo/calls.png", "CALLS_CONFIG"),
    PRODUCT_TYPE10(10, "电影票" ,"" , ""),
    PRODUCT_TYPE11(11, "贵州中石化" , "", "GZ_SINOPEC_CONFIG"),
    PRODUCT_TYPE12(12, "实物商品" , "orderLogo/goods.png", "GOODS"),
    PRODUCT_TYPE13(13, "比邻星停车券" , "orderLogo/coupon.png", "BLX_COUPON"),
    PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"),
    PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"),
    ;

    private Integer number;

    private String name;

    private String imgUrl;

    private String apiCode;

    OrderProductType(int number, String name , String imgUrl , String apiCode) {
        this.number = number;
        this.name = name;
        this.imgUrl = imgUrl;
        this.apiCode = apiCode;
    }

    /**
     * 根据类型查询数据
     * @param type
     * @return
     */
    public static OrderProductType getDataByType(Integer type) {
        for (OrderProductType ele : values()) {
            if(Objects.equals(type,ele.getNumber())) 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 getImgUrl() {
        return imgUrl;
    }

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

    public String getApiCode() {
        return apiCode;
    }

    public void setApiCode(String apiCode) {
        this.apiCode = apiCode;
    }
}
