[성현모] Web.Operation CPMeta 기능 추가

This commit is contained in:
SHM
2025-11-03 14:27:54 +09:00
parent d6c033f149
commit 8198f0b7bb
14 changed files with 384 additions and 5 deletions

View File

@ -0,0 +1,68 @@
using Newtonsoft.Json;
using System;
using SystemX.Core.Communication;
using SystemX.Core.Services;
using Web.Operation.Packet;
using WebClient.Library.Config;
namespace Web.Operation.Services
{
public class CPMetaService
{
private readonly IServiceScopeFactory _scopeFactory;
private readonly ConfigService<WebClientConfig>? _configService;
private string ApiHost = string.Empty;
public CPMetaService(IServiceProvider serviceProvider, IServiceScopeFactory scopeFactory, ConfigService<WebClientConfig> configService)
{
_scopeFactory = scopeFactory;
_configService = configService;
ApiHost = _configService.GetConfig()?.Api.Find(x => x.Id == 1)?.Host;
}
public async Task<Response_GetWbmsMeta> GetWbmsMeta(DateOnly? startDate, DateOnly? endDate, string host)
{
string requestUrl = $"https://{host}/CPMeta/GetWbmsMeta?";
requestUrl += $"startDate={startDate}&";
requestUrl += $"endDate={endDate}&";
requestUrl += $"ShardID=1";
Http http = new Http();
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");
LogXnet.WriteLine($"{res.ToJson()}", LogXLabel.HTTP);
return res;
}
public async Task<Response_GetWbmsMeta> GetWbmsMetaByProductID(string productId, string host)
{
string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByProductID?";
requestUrl += $"ProductID={productId}&";
requestUrl += $"ShardID=1";
Http http = new Http();
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");
LogXnet.WriteLine($"{res.ToJson()}", LogXLabel.HTTP);
return res;
}
public async Task<Response_GetWbmsMeta> GetWbmsMetaByMacAddress(string macAddress, string host)
{
string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByMacAddress?";
requestUrl += $"MacAddress={macAddress}&";
requestUrl += $"ShardID=1";
Http http = new Http();
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");
LogXnet.WriteLine($"{res.ToJson()}", LogXLabel.HTTP);
return res;
}
}
}