[성현모] cpmeta operation shardid 추가

This commit is contained in:
SHM
2025-11-21 14:09:34 +09:00
parent 4eb29fa4fb
commit 70f20e3954
2 changed files with 24 additions and 12 deletions

View File

@ -13,7 +13,10 @@
<RadzenFieldset Style="margin-bottom: 10px;" Text="Server Info"> <RadzenFieldset Style="margin-bottom: 10px;" Text="Server Info">
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
<RadzenLabel Style="width: 130px;" Text="Server Address"></RadzenLabel> <RadzenLabel Style="width: 130px;" Text="Server Address"></RadzenLabel>
<RadzenTextBox Style="margin-right: 10px;" @bind-Value="@ServerAddress"></RadzenTextBox> <RadzenTextBox Style="margin-right: 50px;" @bind-Value="@ServerAddress"></RadzenTextBox>
<RadzenLabel Style="width: 70px;" Text="ShardID"></RadzenLabel>
<RadzenTextBox Style="margin-right: 10px;" @bind-Value="@ShardID"></RadzenTextBox>
</div> </div>
</RadzenFieldset> </RadzenFieldset>
@ -47,6 +50,7 @@
@code { @code {
private string ServerAddress = "192.168.0.126:9000"; private string ServerAddress = "192.168.0.126:9000";
private string ShardID = "1";
private string SearchProductID = string.Empty; private string SearchProductID = string.Empty;
private string SearchProductMacAddress = string.Empty; private string SearchProductMacAddress = string.Empty;
@ -60,8 +64,12 @@
private async Task SearchByProductID() private async Task SearchByProductID()
{ {
PopupService.OpenIndicator(""); PopupService.OpenIndicator("");
if (string.IsNullOrEmpty(SearchProductID) == false)
response = await _cpMetaService.GetWbmsMetaByProductID(SearchProductID, ServerAddress); if(Int32.TryParse(ShardID, out var outValue))
{
if (string.IsNullOrEmpty(SearchProductID) == false)
response = await _cpMetaService.GetWbmsMetaByProductID(SearchProductID, ServerAddress, outValue);
}
await Task.Delay(300); await Task.Delay(300);
PopupService.CloseIndicator(); PopupService.CloseIndicator();
@ -70,8 +78,12 @@
private async Task SearchByMacAddress() private async Task SearchByMacAddress()
{ {
PopupService.OpenIndicator(""); PopupService.OpenIndicator("");
if (string.IsNullOrEmpty(SearchProductMacAddress) == false)
response = await _cpMetaService.GetWbmsMetaByMacAddress(SearchProductMacAddress, ServerAddress); if (Int32.TryParse(ShardID, out var outValue))
{
if (string.IsNullOrEmpty(SearchProductMacAddress) == false)
response = await _cpMetaService.GetWbmsMetaByMacAddress(SearchProductMacAddress, ServerAddress, outValue);
}
await Task.Delay(300); await Task.Delay(300);
PopupService.CloseIndicator(); PopupService.CloseIndicator();

View File

@ -22,12 +22,12 @@ namespace Web.Operation.Services
ApiHost = _configService.GetConfig()?.Api.Find(x => x.Id == 1)?.Host; ApiHost = _configService.GetConfig()?.Api.Find(x => x.Id == 1)?.Host;
} }
public async Task<Response_GetWbmsMeta> GetWbmsMeta(DateOnly? startDate, DateOnly? endDate, string host) public async Task<Response_GetWbmsMeta> GetWbmsMeta(DateOnly? startDate, DateOnly? endDate, string host, int shardID = 1)
{ {
string requestUrl = $"https://{host}/CPMeta/GetWbmsMeta?"; string requestUrl = $"https://{host}/CPMeta/GetWbmsMeta?";
requestUrl += $"startDate={startDate}&"; requestUrl += $"startDate={startDate}&";
requestUrl += $"endDate={endDate}&"; requestUrl += $"endDate={endDate}&";
requestUrl += $"ShardID=1"; requestUrl += $"ShardID={shardID}";
Http http = new Http(); Http http = new Http();
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}"); var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");
@ -37,11 +37,11 @@ namespace Web.Operation.Services
return res; return res;
} }
public async Task<Response_GetWbmsMeta> GetWbmsMetaByProductID(string productId, string host) public async Task<Response_GetWbmsMeta> GetWbmsMetaByProductID(string productId, string host, int shardID = 1)
{ {
string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByProductID?"; string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByProductID?";
requestUrl += $"ProductID={productId}&"; requestUrl += $"ProductID={productId}&";
requestUrl += $"ShardID=1"; requestUrl += $"ShardID={shardID}";
Http http = new Http(); Http http = new Http();
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}"); var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");
@ -51,11 +51,11 @@ namespace Web.Operation.Services
return res; return res;
} }
public async Task<Response_GetWbmsMeta> GetWbmsMetaByMacAddress(string macAddress, string host) public async Task<Response_GetWbmsMeta> GetWbmsMetaByMacAddress(string macAddress, string host, int shardID = 1)
{ {
string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByMacAddress?"; string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByMacAddress?";
requestUrl += $"MacAddress={macAddress}&"; requestUrl += $"MacAddress={macAddress}&";
requestUrl += $"ShardID=1"; requestUrl += $"ShardID={shardID}";
Http http = new Http(); Http http = new Http();
var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}"); var res = await http.GetJsonAsync<Response_GetWbmsMeta>($"{requestUrl}");