alertrule.go file

This commit is contained in:
zhuhoujiu 2025-05-15 08:33:11 +08:00
parent 6f66f3b87b
commit 41d2956b31
2 changed files with 40 additions and 1 deletions

2
.gitignore vendored
View File

@ -6,7 +6,7 @@
vendor vendor
logs logs
go.sum go.sum
hummingbird #hummingbird
## MacOS ## MacOS
.DS_Store .DS_Store

View File

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright 2017.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*******************************************************************************/
package interfaces
import (
"context"
"github.com/winc-link/hummingbird/internal/dtos"
)
type AlertRuleApp interface {
AddAlertRule(ctx context.Context, req dtos.RuleAddRequest) (string, error)
UpdateAlertRule(ctx context.Context, req dtos.RuleUpdateRequest) error
UpdateAlertField(ctx context.Context, req dtos.RuleFieldUpdate) error
AlertRuleById(ctx context.Context, id string) (dtos.RuleResponse, error)
AlertRulesSearch(ctx context.Context, req dtos.AlertRuleSearchQueryRequest) ([]dtos.AlertRuleSearchQueryResponse, uint32, error)
AlertRulesDelete(ctx context.Context, id string) error
AlertRulesStop(ctx context.Context, id string) error
AlertRulesStart(ctx context.Context, id string) error
AlertRulesRestart(ctx context.Context, id string) error
AlertIgnore(ctx context.Context, id string) error
TreatedIgnore(ctx context.Context, id, message string) error
AlertPlate(ctx context.Context, beforeTime int64) ([]dtos.AlertPlateQueryResponse, error)
AlertSearch(ctx context.Context, req dtos.AlertSearchQueryRequest) ([]dtos.AlertSearchQueryResponse, uint32, error)
AddAlert(ctx context.Context, req map[string]interface{}) error
CheckRuleByProductId(ctx context.Context, productId string) error
CheckRuleByDeviceId(ctx context.Context, deviceId string) error
}