package com.schisandra.auth.common.enums;

import lombok.Getter;

/**
 * @Classname OauthType
 * @BelongsProject: schisandra-cloud-storage
 * @BelongsPackage: com.schisandra.auth.common.enums
 * @Author: landaiqing
 * @CreateTime: 2024-05-26  13:36
 * @Description: TODO
 * @Version: 1.0
 */
@Getter
public enum OauthType {

    /**
     * 微信登录
     */
    WECHAT("wechat"),
    /**
     * QQ登录
     */
    QQ("qq"),
    /**
     * 微博登录
     */
    WEIBO("weibo"),
    /**
     * 支付宝登录
     */
    ALIPAY("alipay"),
    /**
     * 钉钉登录
     */
    DINGTALK("dingtalk"),
    /**
     * 企业微信登录
     */
    WORK_WEIXIN("work_weixin"),
    /**
     * Github
     */
    GitHUB("github"),
    /**
     * Gitee
     */
    Gitee("gitee");

    public String type;

    OauthType(String type) {
        this.type = type;
    }
    public static OauthType getByType(String type) {
        for (OauthType resultKeyEnum : OauthType.values()) {
            if (resultKeyEnum.type.equals(type)) {
                return resultKeyEnum;
            }
        }
        return null;
    }
}
