40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using SystemX.Core.Communication;
|
|
using SystemX.Core.Services;
|
|
using Web.Operation.Packet;
|
|
using WebClient.Library.Config;
|
|
|
|
namespace Web.Operation.Services
|
|
{
|
|
public class ProxyKMSService
|
|
{
|
|
private readonly IServiceScopeFactory _scopeFactory;
|
|
private readonly ConfigService<WebClientConfig>? _configService;
|
|
|
|
private string ApiHost = string.Empty;
|
|
|
|
public ProxyKMSService(IServiceProvider serviceProvider, IServiceScopeFactory scopeFactory, ConfigService<WebClientConfig> configService)
|
|
{
|
|
_scopeFactory = scopeFactory;
|
|
_configService = configService;
|
|
}
|
|
|
|
public async Task<RESPONSE> PostKms<REQUEST,RESPONSE>(string url, REQUEST request) where REQUEST : class where RESPONSE : class
|
|
{
|
|
|
|
Http http = new Http();
|
|
var res = await http.PostJsonAsync<REQUEST,RESPONSE>($"{url}", request);
|
|
|
|
return res;
|
|
}
|
|
|
|
public async Task<RESPONSE> PutKms<REQUEST, RESPONSE>(string url, REQUEST request) where REQUEST : class where RESPONSE : class
|
|
{
|
|
|
|
Http http = new Http();
|
|
var res = await http.PutJsonAsync<REQUEST, RESPONSE>($"{url}", request);
|
|
|
|
return res;
|
|
}
|
|
}
|
|
}
|