增加修改节点停用/启用状态API

This commit is contained in:
刘祥超
2024-01-21 17:43:20 +08:00
parent b99652801d
commit 32c1442878
2 changed files with 39 additions and 1 deletions

View File

@@ -2293,3 +2293,19 @@ func (this *NodeService) FindNodeWebPPolicies(ctx context.Context, req *pb.FindN
WebPPolicies: pbPolicies,
}, nil
}
// UpdateNodeIsOn 修改节点的启用状态
func (this *NodeService) UpdateNodeIsOn(ctx context.Context, req *pb.UpdateNodeIsOnRequest) (*pb.RPCSuccess, error) {
_, err := this.ValidateAdmin(ctx)
if err != nil {
return nil, err
}
var tx = this.NullTx()
err = models.SharedNodeDAO.UpdateNodeIsOn(tx, req.NodeId, req.IsOn)
if err != nil {
return nil, err
}
return this.Success()
}