package org.springblade.auth.enums;

import lombok.Getter;

@Getter
public enum ThirdPartyLoginType {

    dingTalk("dingTalk","钉钉"),

    weChat("wechat","微信"),

    qiWeChat("wechat_enterprise","企业微信"),

//    qiWeChatWeb("wechat_enterprise_web","企业微信网页登录"),

    feiShu("feiShu","飞书");

    private final String value;

    private final String message;

    ThirdPartyLoginType(String value,String message) {
        this.message = message;
        this.value = value;
    }

    public ThirdPartyLoginType getByMessage(String message){
        ThirdPartyLoginType[] values = ThirdPartyLoginType.values();
        for (ThirdPartyLoginType thirdPartyLoginType : values) {
            if (thirdPartyLoginType.message.equals(message)){
                return thirdPartyLoginType;
            }
        }

        return null;
    }

    public ThirdPartyLoginType getByValue(String value){
        ThirdPartyLoginType[] values = ThirdPartyLoginType.values();
        for (ThirdPartyLoginType thirdPartyLoginType : values) {
            if (thirdPartyLoginType.value.equals(value)){
                return thirdPartyLoginType;
            }
        }

        return null;
    }
}
