package com.flossom.common.core.enums;

/**
 * 站点管理：
 * site_info：open_type
 */
public enum SiteOpenTypeEnum {
    FIRST_PAGE_MODULE(1, "首页"), DISCOVER_MODULE(2, "发现模块"), ACTIVITY_MODULE(3, "活动模块");

    private final Integer code;
    private final String info;

    SiteOpenTypeEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static SiteOpenTypeEnum getOpenType(Integer openType) {
        for (SiteOpenTypeEnum openTypeEnum : SiteOpenTypeEnum.values()) {
            if (openTypeEnum.getCode() == openType) {
                return openTypeEnum;
            }
        }
        return null;
    }
}
