init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
30
Kreta.BusinessLogic/Helpers/FileUpload/TokenServiceHelper.cs
Normal file
30
Kreta.BusinessLogic/Helpers/FileUpload/TokenServiceHelper.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Client.FileService;
|
||||
|
||||
namespace Kreta.BusinessLogic.Helpers
|
||||
{
|
||||
internal class TokenServiceHelper : ITokenServiceHelper
|
||||
{
|
||||
private readonly IFileServiceClient fileServiceClient;
|
||||
|
||||
public TokenServiceHelper(IFileServiceClient fileServiceClient)
|
||||
{
|
||||
this.fileServiceClient = fileServiceClient ?? throw new ArgumentNullException(nameof(fileServiceClient));
|
||||
}
|
||||
|
||||
public (string, int) GetPublicTokenWithExpiresIn()
|
||||
{
|
||||
var response = fileServiceClient.GetPublicToken();
|
||||
|
||||
return (response.AccessToken, response.ExpiresIn);
|
||||
}
|
||||
|
||||
public (string, int) GetPrivateTokenWithExpiresIn()
|
||||
{
|
||||
var response = fileServiceClient.GetPrivateToken();
|
||||
|
||||
return (response.AccessToken, response.ExpiresIn);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue