package com.hfkj.sysenum.cms;

import lombok.Getter;

import java.util.Objects;

/**
 * @className: CmsTypeEnum
 * @author: HuRui
 * @date: 2024/9/24
 **/
@Getter
public enum CmsTypeEnum {
    /**
     * 首页轮播图
     */
    type1(1 , "首页轮播图"),

    /**
     * 首页弹出框
     */
    type2(2 , "首页弹出框"),
    ;

    private Integer type;

    private String name;

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

    public static CmsTypeEnum getDataByType(Integer type) {
        for (CmsTypeEnum ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele;
        }
        return null;
    }

}
