package com.jeesharp.business.modules.setting.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 站点图标启用状态，与表字段 {@code cms_site_icon.status} 对齐。
 *
 * @author jeesharp
 * @since 2026-05-15
 */
@Getter
@AllArgsConstructor
public enum SiteIconStatusEnum {

    /** 禁用 */
    DISABLED(0, "禁用"),

    /** 启用 */
    ENABLED(1, "启用");

    private final Integer value;
    private final String desc;

    public static SiteIconStatusEnum fromValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (SiteIconStatusEnum e : values()) {
            if (e.getValue().equals(value)) {
                return e;
            }
        }
        return null;
    }

    public static String getDescByValue(Integer value) {
        SiteIconStatusEnum e = fromValue(value);
        return e != null ? e.getDesc() : "";
    }
}
