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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 内容安全 Provider 标识，用于配置路由与审计流水。
 *
 * @author jeesharp
 * @since 2026-06-27
 */
@Getter
@AllArgsConstructor
public enum ContentSecurityProviderCodeEnum {

    WECHAT_MINI("WECHAT_MINI", "微信小程序内容安全"),
    LOCAL_WORD("LOCAL_WORD", "本地敏感词"),
    NONE("NONE", "未启用/跳过");

    private final String code;
    private final String desc;

    public static ContentSecurityProviderCodeEnum fromCode(String code) {
        if (code == null) {
            return null;
        }
        for (ContentSecurityProviderCodeEnum e : values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
