优化代码

This commit is contained in:
GoEdgeLab
2022-07-22 14:35:17 +08:00
parent 384de90f00
commit 95e849c998
80 changed files with 462 additions and 463 deletions

View File

@@ -17,7 +17,7 @@ type NodeThresholdService struct {
// CreateNodeThreshold 创建阈值
func (this *NodeThresholdService) CreateNodeThreshold(ctx context.Context, req *pb.CreateNodeThresholdRequest) (*pb.CreateNodeThresholdResponse, error) {
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -31,7 +31,7 @@ func (this *NodeThresholdService) CreateNodeThreshold(ctx context.Context, req *
// UpdateNodeThreshold 创建阈值
func (this *NodeThresholdService) UpdateNodeThreshold(ctx context.Context, req *pb.UpdateNodeThresholdRequest) (*pb.RPCSuccess, error) {
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -45,7 +45,7 @@ func (this *NodeThresholdService) UpdateNodeThreshold(ctx context.Context, req *
// DeleteNodeThreshold 删除阈值
func (this *NodeThresholdService) DeleteNodeThreshold(ctx context.Context, req *pb.DeleteNodeThresholdRequest) (*pb.RPCSuccess, error) {
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -59,7 +59,7 @@ func (this *NodeThresholdService) DeleteNodeThreshold(ctx context.Context, req *
// FindAllEnabledNodeThresholds 查询阈值
func (this *NodeThresholdService) FindAllEnabledNodeThresholds(ctx context.Context, req *pb.FindAllEnabledNodeThresholdsRequest) (*pb.FindAllEnabledNodeThresholdsResponse, error) {
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -108,7 +108,7 @@ func (this *NodeThresholdService) FindAllEnabledNodeThresholds(ctx context.Conte
// CountAllEnabledNodeThresholds 计算阈值数量
func (this *NodeThresholdService) CountAllEnabledNodeThresholds(ctx context.Context, req *pb.CountAllEnabledNodeThresholdsRequest) (*pb.RPCCountResponse, error) {
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
@@ -123,7 +123,7 @@ func (this *NodeThresholdService) CountAllEnabledNodeThresholds(ctx context.Cont
// FindEnabledNodeThreshold 查询单个阈值详情
func (this *NodeThresholdService) FindEnabledNodeThreshold(ctx context.Context, req *pb.FindEnabledNodeThresholdRequest) (*pb.FindEnabledNodeThresholdResponse, error) {
_, err := this.ValidateAdmin(ctx, 0)
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}