From e50ae537406abf247487ac0b7a56ac011f36242b Mon Sep 17 00:00:00 2001 From: token <61819790+239573049@users.noreply.github.com> Date: Sun, 18 Feb 2024 09:39:15 +0800 Subject: [PATCH] Update BaseCallerService.cs (#340) --- .../Base/BaseCallerService.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ApiGateways/Caller/Masa.Alert.ApiGateways.Caller/Base/BaseCallerService.cs b/src/ApiGateways/Caller/Masa.Alert.ApiGateways.Caller/Base/BaseCallerService.cs index ac8fc931..09949418 100644 --- a/src/ApiGateways/Caller/Masa.Alert.ApiGateways.Caller/Base/BaseCallerService.cs +++ b/src/ApiGateways/Caller/Masa.Alert.ApiGateways.Caller/Base/BaseCallerService.cs @@ -13,32 +13,32 @@ protected ServiceBase(ICaller caller) protected async Task GetAsync(string methodName, Dictionary? paramters = null) { - return await Caller.GetAsync(BuildAdress(methodName), paramters ?? new()) ?? throw new UserFriendlyException("The service is abnormal, please contact the administrator!"); + return await Caller.GetAsync(BuildAddress(methodName), paramters ?? new()) ?? throw new UserFriendlyException("The service is abnormal, please contact the administrator!"); } protected async Task GetAsync(string methodName, TRequest data) where TRequest : class { - return await Caller.GetAsync(BuildAdress(methodName), data) ?? throw new UserFriendlyException("The service is abnormal, please contact the administrator!"); + return await Caller.GetAsync(BuildAddress(methodName), data) ?? throw new UserFriendlyException("The service is abnormal, please contact the administrator!"); } protected async Task PutAsync(string methodName, TRequest data) { - await Caller.PutAsync(BuildAdress(methodName), data); + await Caller.PutAsync(BuildAddress(methodName), data); } protected async Task PostAsync(string methodName, TRequest data) { - await Caller.PostAsync(BuildAdress(methodName), data); + await Caller.PostAsync(BuildAddress(methodName), data); } protected async Task DeleteAsync(string methodName, TRequest? data = default) { - await Caller.DeleteAsync(BuildAdress(methodName), data); + await Caller.DeleteAsync(BuildAddress(methodName), data); } protected async Task DeleteAsync(string methodName) { - await Caller.DeleteAsync(BuildAdress(methodName), null); + await Caller.DeleteAsync(BuildAddress(methodName), null); } protected async Task SendAsync(string methodName, TRequest? data = default) @@ -59,10 +59,10 @@ protected async Task SendAsync(string methodName, TRequest? data = def protected async Task SendAsync(string methodName, TRequest data) where TRequest : class { - return await Caller.GetAsync(BuildAdress(methodName), data) ?? throw new Exception("The service is abnormal, please contact the administrator!"); + return await Caller.GetAsync(BuildAddress(methodName), data) ?? throw new Exception("The service is abnormal, please contact the administrator!"); } - private string BuildAdress(string methodName) + private string BuildAddress(string methodName) { return Path.Combine(BaseUrl, methodName.Replace("Async", "")); }