From 70f20e3954a82346152770fd6c68e6e17c701f4c Mon Sep 17 00:00:00 2001 From: SHM Date: Fri, 21 Nov 2025 14:09:34 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=84=B1=ED=98=84=EB=AA=A8]=20cpmeta=20operat?= =?UTF-8?q?ion=20shardid=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Pages/CPMeta.razor | 24 ++++++++++++++----- .../Web.Operation/Services/CPMetaService.cs | 12 +++++----- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor b/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor index 28dd133..98823c1 100644 --- a/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor +++ b/Projects/WebClient/Web.Operation/Components/Pages/CPMeta.razor @@ -13,7 +13,10 @@
- + + + +
@@ -47,9 +50,10 @@ @code { private string ServerAddress = "192.168.0.126:9000"; + private string ShardID = "1"; private string SearchProductID = string.Empty; private string SearchProductMacAddress = string.Empty; - + Response_GetWbmsMeta response = new Response_GetWbmsMeta(); protected override async Task OnInitializedAsync() @@ -60,8 +64,12 @@ private async Task SearchByProductID() { 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); PopupService.CloseIndicator(); @@ -70,8 +78,12 @@ private async Task SearchByMacAddress() { 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); PopupService.CloseIndicator(); diff --git a/Projects/WebClient/Web.Operation/Services/CPMetaService.cs b/Projects/WebClient/Web.Operation/Services/CPMetaService.cs index b0bc95c..6018c03 100644 --- a/Projects/WebClient/Web.Operation/Services/CPMetaService.cs +++ b/Projects/WebClient/Web.Operation/Services/CPMetaService.cs @@ -22,12 +22,12 @@ namespace Web.Operation.Services ApiHost = _configService.GetConfig()?.Api.Find(x => x.Id == 1)?.Host; } - public async Task GetWbmsMeta(DateOnly? startDate, DateOnly? endDate, string host) + public async Task GetWbmsMeta(DateOnly? startDate, DateOnly? endDate, string host, int shardID = 1) { string requestUrl = $"https://{host}/CPMeta/GetWbmsMeta?"; requestUrl += $"startDate={startDate}&"; requestUrl += $"endDate={endDate}&"; - requestUrl += $"ShardID=1"; + requestUrl += $"ShardID={shardID}"; Http http = new Http(); var res = await http.GetJsonAsync($"{requestUrl}"); @@ -37,11 +37,11 @@ namespace Web.Operation.Services return res; } - public async Task GetWbmsMetaByProductID(string productId, string host) + public async Task GetWbmsMetaByProductID(string productId, string host, int shardID = 1) { string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByProductID?"; requestUrl += $"ProductID={productId}&"; - requestUrl += $"ShardID=1"; + requestUrl += $"ShardID={shardID}"; Http http = new Http(); var res = await http.GetJsonAsync($"{requestUrl}"); @@ -51,11 +51,11 @@ namespace Web.Operation.Services return res; } - public async Task GetWbmsMetaByMacAddress(string macAddress, string host) + public async Task GetWbmsMetaByMacAddress(string macAddress, string host, int shardID = 1) { string requestUrl = $"https://{host}/CPMeta/GetWbmsMetaByMacAddress?"; requestUrl += $"MacAddress={macAddress}&"; - requestUrl += $"ShardID=1"; + requestUrl += $"ShardID={shardID}"; Http http = new Http(); var res = await http.GetJsonAsync($"{requestUrl}");