From 435de40feb843a97129e09d06c98336ef0ec0735 Mon Sep 17 00:00:00 2001 From: wzh425 Date: Tue, 11 Apr 2023 16:33:11 +0800 Subject: [PATCH] feat(alert-sdk) : AlarmRuleService Add SetIsEnabledAsync (#549) --- .../Service/IAlarmRuleService.cs | 2 ++ .../Service/AlarmRuleService.cs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs index f748e4ce1..331cc3827 100644 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Alert/Service/IAlarmRuleService.cs @@ -12,4 +12,6 @@ public interface IAlarmRuleService Task DeleteAsync(Guid id); Task GetAsync(Guid id); + + Task SetIsEnabledAsync(Guid id, bool isEnabled); } diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Alert/Service/AlarmRuleService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Alert/Service/AlarmRuleService.cs index c43a45dd1..38586c86b 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Alert/Service/AlarmRuleService.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Alert/Service/AlarmRuleService.cs @@ -36,4 +36,10 @@ public async Task DeleteAsync(Guid id) var requestUri = $"{_party}/{id}"; return await _caller.GetAsync(requestUri); } + + public async Task SetIsEnabledAsync(Guid id, bool isEnabled) + { + var requestUri = $"{_party}/{id}/enabled/{isEnabled}"; + await _caller.PutAsync(requestUri, null); + } }