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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 第三方 OAuth 平台
 *
 * @author jeesharp
 * @version 2026-03-19
 */
@Getter
@AllArgsConstructor
public enum OauthPlatformEnum {

    WECHAT("WECHAT", "微信"),
    HUAWEI("HUAWEI", "华为"),
    ALIPAY("ALIPAY", "支付宝"),
    QQ("QQ", "QQ"),
    WEIBO("WEIBO", "微博"),
    DOUYIN("DOUYIN", "抖音"),
    APPLE("APPLE", "苹果"),
    DINGTALK("DINGTALK", "钉钉"),
    FEISHU("FEISHU", "飞书");

    private final String value;
    private final String desc;

    public static OauthPlatformEnum fromValue(String value) {
        if (value == null || value.isEmpty()) {
            return null;
        }
        for (OauthPlatformEnum e : values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return null;
    }
}
