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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 第三方应用类型（与具体 app_id 组合区分多小程序/多公众号等）
 *
 * @author jeesharp
 * @version 2026-03-19
 */
@Getter
@AllArgsConstructor
public enum OauthAppTypeEnum {

    MINI("MINI", "微信小程序"),
    MP("MP", "微信公众号"),
    APP("APP", "移动应用"),
    OPEN("OPEN", "开放平台/通用"),
    ATOMIC("ATOMIC", "鸿蒙元服务"),
    WORK("WORK", "企业微信");

    private final String value;
    private final String desc;

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