示例#1
0
 public CallConversor(CallTokenService tokenService)
 {
     if (tokenService != null)
     {
         _token = tokenService.CallTokenConversor();
     }
 }
示例#2
0
        public IActionResult GetToken(int token_Type)
        {
            GetTokenViewModel tokenViewModel = new GetTokenViewModel();

            tokenViewModel.Token = "Token no disponible";
            TokenBearer token = null;

            if (token_Type.Equals((int)TokensEnum.TokenCarga))
            {
                token = _callTokenService.CallTokenCarga();
            }
            else if (token_Type.Equals((int)TokensEnum.TokenCron))
            {
                token = _callTokenService.CallTokenCron();
            }
            else if (token_Type.Equals((int)TokensEnum.TokenUrisFactory))
            {
                token = _callTokenService.CallTokenUrisFactory();
            }
            else if (token_Type.Equals((int)TokensEnum.TokenOAIPMH))
            {
                token = _callTokenService.CallTokenOAIPMH();
            }
            else if (token_Type.Equals((int)TokensEnum.TokenDocumentacion))
            {
                token = _callTokenService.CallTokenApiDocumentacion();
            }
            else if (token_Type.Equals((int)TokensEnum.TokenConversor))
            {
                token = _callTokenService.CallTokenConversor();
            }

            if (token != null)
            {
                tokenViewModel.Token = $"{token.token_type} {token.access_token}";
            }

            tokenViewModel.TokenOptions = LoadTokenList();
            return(View("Index", tokenViewModel));
        }