package com.yunzhupaas.permission.util.implicit;

import me.zhyd.oauth.config.AuthSource;
import me.zhyd.oauth.request.AuthDefaultRequest;
import me.zhyd.oauth.request.AuthDingTalkRequest;

/**
 * 免登陆接口 通用接口
 *
 * @author 云筑产品开发平台组
 * @version v5.0.0
 * @copyright 深圳市乐程软件有限公司
 * @date 2024/5/23 11:09:55
 */
public enum ImplicitDefaultSource implements AuthSource {
    WECHAT_ENTERPRISE {
        public String authorize() {
            return "https://open.weixin.qq.com/connect/oauth2/authorize";
        }

        public String accessToken() {
            return "https://qyapi.weixin.qq.com/cgi-bin/gettoken";
        }

        public String userInfo() {
            return "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo";
        }

        public Class<? extends AuthDefaultRequest> getTargetClass() {
            return AuthDingTalkRequest.class;
        }
    },
    DINGTALK {
        public String authorize() {
            return "https://oapi.dingtalk.com/connect/oauth2/sns_authorize";
        }

        public String accessToken() {
            return "https://oapi.dingtalk.com/gettoken";

        }

        public String userInfo() {
            return "https://oapi.dingtalk.com/topapi/v2/user/getuserinfo";
        }

        public Class<? extends AuthDefaultRequest> getTargetClass() {
            return AuthDingTalkRequest.class;
        }
    },
    ;

    private ImplicitDefaultSource() {
    }
}

