package com.huimv.video.dhicc.test.manager.impl;


import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo;
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo02;
import com.huimv.video.dhicc.test.config.OauthConfigBaseInfo03;
import com.huimv.video.dhicc.test.manager.IOauthIntegrationManager;
import com.huimv.video.dhicc.test.other.BaseIntegrationManager;
import com.huimv.video.dhicc.test.request.GetPublicKeyRequest;
import com.huimv.video.dhicc.test.request.GetTokenRequestTest01;
import com.huimv.video.dhicc.test.request.GetTokenRequestTest02;
import com.huimv.video.dhicc.test.request.GetTokenRequestTest03;
import com.huimv.video.dhicc.test.response.GetPublicKeyResponse;
import com.huimv.video.dhicc.test.response.GetTokenResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 鉴权服务集成实现类
 */
@Service
public class OauthIntegrationManager extends BaseIntegrationManager implements IOauthIntegrationManager {

    @Autowired
    public OauthConfigBaseInfo oauthConfigBaseInfo;
    @Autowired
    public OauthConfigBaseInfo02 oauthConfigBaseInfo02;
    @Autowired
    public OauthConfigBaseInfo03 oauthConfigBaseInfo03;


    /**
     * 获取公钥
     **/
    @Override
    public GetPublicKeyResponse getPublicKey() {
        logger.info("OauthController,getPublicKey");
        GetPublicKeyRequest request = new GetPublicKeyRequest(oauthConfigBaseInfo);
        GetPublicKeyResponse getPublicKeyResponse = request.doAction();
        return getPublicKeyResponse;
    }

  /*  *//**
     * 获取token
     **//*
    @Override
    public GetTokenResponse getToken() {
        logger.info("OauthController,getToken");
        GetTokenRequest request = new GetTokenRequest(oauthConfigBaseInfo);
        GetTokenResponse getTokenResponse = request.doAction();
        return getTokenResponse;
    }*/

    @Override
    public GetTokenResponse getTokenTest01() {
        logger.info("OauthController,getToken");
        GetTokenRequestTest01 request = new GetTokenRequestTest01(oauthConfigBaseInfo);
        GetTokenResponse getTokenResponse = request.doAction();
        return getTokenResponse;
    }

    @Override
    public GetTokenResponse getTokenTest02() {
        logger.info("OauthController,getToken");
        GetTokenRequestTest02 request = new GetTokenRequestTest02(oauthConfigBaseInfo02);
        GetTokenResponse getTokenResponse = request.doAction();
        return getTokenResponse;
    }

    @Override
    public GetTokenResponse getTokenTest03() {
        logger.info("OauthController,getToken");
        GetTokenRequestTest03 request = new GetTokenRequestTest03(oauthConfigBaseInfo03);
        GetTokenResponse getTokenResponse = request.doAction();
        return getTokenResponse;
    }
}