优化代码

This commit is contained in:
刘祥超
2023-06-01 18:08:45 +08:00
parent b7768ea0c0
commit a65255e4e5
2 changed files with 13 additions and 25 deletions

View File

@@ -1512,31 +1512,6 @@ func (this *NodeClusterService) UpdateNodeClusterHTTPPagesPolicy(ctx context.Con
return this.Success()
}
// FindNodeClusterHTTP3Policy 获取集群的HTTP3设置
func (this *NodeClusterService) FindNodeClusterHTTP3Policy(ctx context.Context, req *pb.FindNodeClusterHTTP3PolicyRequest) (*pb.FindNodeClusterHTTP3PolicyResponse, error) {
if !teaconst.IsPlus {
return nil, this.NotImplementedYet()
}
_, _, err := this.ValidateAdminAndUser(ctx, false)
if err != nil {
return nil, err
}
var tx = this.NullTx()
http3Policy, err := models.SharedNodeClusterDAO.FindClusterHTTP3Policy(tx, req.NodeClusterId, nil)
if err != nil {
return nil, err
}
http3PolicyJSON, err := json.Marshal(http3Policy)
if err != nil {
return nil, err
}
return &pb.FindNodeClusterHTTP3PolicyResponse{
Http3PolicyJSON: http3PolicyJSON,
}, nil
}
// UpdateNodeClusterHTTP3Policy 修改集群的HTTP3设置
func (this *NodeClusterService) UpdateNodeClusterHTTP3Policy(ctx context.Context, req *pb.UpdateNodeClusterHTTP3PolicyRequest) (*pb.RPCSuccess, error) {
if !teaconst.IsPlus {

View File

@@ -0,0 +1,13 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
//go:build !plus
package services
import (
"context"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
func (this *NodeClusterService) FindNodeClusterHTTP3Policy(ctx context.Context, req *pb.FindNodeClusterHTTP3PolicyRequest) (*pb.FindNodeClusterHTTP3PolicyResponse, error) {
return nil, this.NotImplementedYet()
}