package com.hai.enum_type;

import java.util.Objects;

/**
 * @serviceName CmsContentDataEnum.java
 * @author Sum1Dream
 * @version 1.0.0
 * @Description // CMS内容数据
 * @createTime 09:22 2022/9/28
 **/
public enum CmsContentDataEnum {

    REFUEL(1 , "加油专区"),
    INTEGRAL(2 , "积分专区"),
    UNION_PAY(3 , "银联专区"),
    PREFERABLY(4 , "优选商品"),
    UNION_CARD(5 , "工会卡专区"),
    DISCOUNT(6 , "天天好券"),
    BLX_COUPON(7 , "停车券专区"),
    MSG(90 , "消息通知"),
    ;

    private Integer type;
    private String name;


    CmsContentDataEnum(int type , String name) {
        this.type = type;
        this.name = name;
    }

    public static Integer getTypeByName(String name) {
        for (CmsContentDataEnum ele : values()) {
            if(Objects.equals(name,ele.getName())) return ele.getType();
        }
        return null;
    }


    public Integer getType() {
        return type;
    }

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

    public String getName() {
        return name;
    }

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