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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 隐私政策/法律文档状态枚举。
 *
 * @author jeesharp
 * @since 2026-05-20
 */
@Getter
@AllArgsConstructor
public enum PrivacyPolicyStatusEnum {

    DISABLED(0, "禁用"),
    ENABLED(1, "启用");

    private final Integer value;
    private final String desc;

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

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