mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-11 04:50:25 +08:00
节点IP地址可以设置阈值
This commit is contained in:
@@ -4,6 +4,7 @@ package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
teaconst "github.com/TeaOSLab/EdgeAPI/internal/const"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
rpcutils "github.com/TeaOSLab/EdgeAPI/internal/rpc/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
@@ -39,12 +40,21 @@ func (this *NodeValueService) CreateNodeValue(ctx context.Context, req *pb.Creat
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 触发阈值
|
||||
// 触发节点阈值
|
||||
err = models.SharedNodeThresholdDAO.FireNodeThreshold(tx, role, nodeId, req.Item)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 触发IP阈值
|
||||
// 企业版专有
|
||||
if teaconst.IsPlus {
|
||||
err = models.SharedNodeIPAddressDAO.FireThresholds(tx, role, nodeId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return this.Success()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user