增加置顶集群功能

This commit is contained in:
GoEdgeLab
2022-03-17 11:12:46 +08:00
parent 81f0179011
commit d28fc89a1f
5 changed files with 30 additions and 2 deletions

View File

@@ -298,6 +298,7 @@ func (this *NodeClusterService) ListEnabledNodeClusters(ctx context.Context, req
DnsDomainId: int64(cluster.DnsDomainId),
IsOn: cluster.IsOn == 1,
TimeZone: cluster.TimeZone,
IsPinned: cluster.IsPinned == 1,
})
}
@@ -1026,3 +1027,19 @@ func (this *NodeClusterService) FindEnabledNodeClusterConfigInfo(ctx context.Con
return result, nil
}
// UpdateNodeClusterPinned 设置集群是否置顶
func (this *NodeClusterService) UpdateNodeClusterPinned(ctx context.Context, req *pb.UpdateNodeClusterPinnedRequest) (*pb.RPCSuccess, error) {
_, err := this.ValidateAdmin(ctx, 0)
if err != nil {
return nil, err
}
var tx = this.NullTx()
err = models.SharedNodeClusterDAO.UpdateClusterIsPinned(tx, req.NodeClusterId, req.IsPinned)
if err != nil {
return nil, err
}
return this.Success()
}