Просмотр исходного кода

perf: 节点端口使用情况表批量添加接口

BaiLuoYan 2 месяцев назад
Родитель
Сommit
2573872e4f

+ 2 - 0
pb/client/gogameclient/go_game_client.go

@@ -449,6 +449,8 @@ type (
 	VpnServerLocationVo                                  = pb.VpnServerLocationVo
 	VpnServerPortAddReq                                  = pb.VpnServerPortAddReq
 	VpnServerPortAddResp                                 = pb.VpnServerPortAddResp
+	VpnServerPortBatchAddReq                             = pb.VpnServerPortBatchAddReq
+	VpnServerPortBatchAddResp                            = pb.VpnServerPortBatchAddResp
 	VpnServerPortDelReq                                  = pb.VpnServerPortDelReq
 	VpnServerPortGetReq                                  = pb.VpnServerPortGetReq
 	VpnServerPortGetResp                                 = pb.VpnServerPortGetResp

+ 2 - 0
pb/client/goplanclient/go_plan_client.go

@@ -449,6 +449,8 @@ type (
 	VpnServerLocationVo                                  = pb.VpnServerLocationVo
 	VpnServerPortAddReq                                  = pb.VpnServerPortAddReq
 	VpnServerPortAddResp                                 = pb.VpnServerPortAddResp
+	VpnServerPortBatchAddReq                             = pb.VpnServerPortBatchAddReq
+	VpnServerPortBatchAddResp                            = pb.VpnServerPortBatchAddResp
 	VpnServerPortDelReq                                  = pb.VpnServerPortDelReq
 	VpnServerPortGetReq                                  = pb.VpnServerPortGetReq
 	VpnServerPortGetResp                                 = pb.VpnServerPortGetResp

+ 2 - 0
pb/client/gopmpclient/go_pmp_client.go

@@ -449,6 +449,8 @@ type (
 	VpnServerLocationVo                                  = pb.VpnServerLocationVo
 	VpnServerPortAddReq                                  = pb.VpnServerPortAddReq
 	VpnServerPortAddResp                                 = pb.VpnServerPortAddResp
+	VpnServerPortBatchAddReq                             = pb.VpnServerPortBatchAddReq
+	VpnServerPortBatchAddResp                            = pb.VpnServerPortBatchAddResp
 	VpnServerPortDelReq                                  = pb.VpnServerPortDelReq
 	VpnServerPortGetReq                                  = pb.VpnServerPortGetReq
 	VpnServerPortGetResp                                 = pb.VpnServerPortGetResp

+ 2 - 0
pb/client/goshortdramaclient/go_short_drama_client.go

@@ -449,6 +449,8 @@ type (
 	VpnServerLocationVo                                  = pb.VpnServerLocationVo
 	VpnServerPortAddReq                                  = pb.VpnServerPortAddReq
 	VpnServerPortAddResp                                 = pb.VpnServerPortAddResp
+	VpnServerPortBatchAddReq                             = pb.VpnServerPortBatchAddReq
+	VpnServerPortBatchAddResp                            = pb.VpnServerPortBatchAddResp
 	VpnServerPortDelReq                                  = pb.VpnServerPortDelReq
 	VpnServerPortGetReq                                  = pb.VpnServerPortGetReq
 	VpnServerPortGetResp                                 = pb.VpnServerPortGetResp

+ 2 - 0
pb/client/gosysclient/go_sys_client.go

@@ -449,6 +449,8 @@ type (
 	VpnServerLocationVo                                  = pb.VpnServerLocationVo
 	VpnServerPortAddReq                                  = pb.VpnServerPortAddReq
 	VpnServerPortAddResp                                 = pb.VpnServerPortAddResp
+	VpnServerPortBatchAddReq                             = pb.VpnServerPortBatchAddReq
+	VpnServerPortBatchAddResp                            = pb.VpnServerPortBatchAddResp
 	VpnServerPortDelReq                                  = pb.VpnServerPortDelReq
 	VpnServerPortGetReq                                  = pb.VpnServerPortGetReq
 	VpnServerPortGetResp                                 = pb.VpnServerPortGetResp

+ 2 - 0
pb/client/gouserclient/go_user_client.go

@@ -449,6 +449,8 @@ type (
 	VpnServerLocationVo                                  = pb.VpnServerLocationVo
 	VpnServerPortAddReq                                  = pb.VpnServerPortAddReq
 	VpnServerPortAddResp                                 = pb.VpnServerPortAddResp
+	VpnServerPortBatchAddReq                             = pb.VpnServerPortBatchAddReq
+	VpnServerPortBatchAddResp                            = pb.VpnServerPortBatchAddResp
 	VpnServerPortDelReq                                  = pb.VpnServerPortDelReq
 	VpnServerPortGetReq                                  = pb.VpnServerPortGetReq
 	VpnServerPortGetResp                                 = pb.VpnServerPortGetResp

+ 8 - 0
pb/client/govpnclient/go_vpn_client.go

@@ -449,6 +449,8 @@ type (
 	VpnServerLocationVo                                  = pb.VpnServerLocationVo
 	VpnServerPortAddReq                                  = pb.VpnServerPortAddReq
 	VpnServerPortAddResp                                 = pb.VpnServerPortAddResp
+	VpnServerPortBatchAddReq                             = pb.VpnServerPortBatchAddReq
+	VpnServerPortBatchAddResp                            = pb.VpnServerPortBatchAddResp
 	VpnServerPortDelReq                                  = pb.VpnServerPortDelReq
 	VpnServerPortGetReq                                  = pb.VpnServerPortGetReq
 	VpnServerPortGetResp                                 = pb.VpnServerPortGetResp
@@ -669,6 +671,7 @@ type (
 		VpnServerPortDel(ctx context.Context, in *VpnServerPortDelReq, opts ...grpc.CallOption) (*Empty, error)
 		VpnServerPortGet(ctx context.Context, in *VpnServerPortGetReq, opts ...grpc.CallOption) (*VpnServerPortGetResp, error)
 		VpnServerPortList(ctx context.Context, in *VpnServerPortListReq, opts ...grpc.CallOption) (*VpnServerPortListResp, error)
+		VpnServerPortBatchAdd(ctx context.Context, in *VpnServerPortBatchAddReq, opts ...grpc.CallOption) (*VpnServerPortBatchAddResp, error)
 	}
 
 	defaultGoVpnClient struct {
@@ -1213,3 +1216,8 @@ func (m *defaultGoVpnClient) VpnServerPortList(ctx context.Context, in *VpnServe
 	client := pb.NewGoVpnClientClient(m.cli.Conn())
 	return client.VpnServerPortList(ctx, in, opts...)
 }
+
+func (m *defaultGoVpnClient) VpnServerPortBatchAdd(ctx context.Context, in *VpnServerPortBatchAddReq, opts ...grpc.CallOption) (*VpnServerPortBatchAddResp, error) {
+	client := pb.NewGoVpnClientClient(m.cli.Conn())
+	return client.VpnServerPortBatchAdd(ctx, in, opts...)
+}

+ 13 - 3
pb/gorpc.proto

@@ -3543,15 +3543,24 @@ message VpnServerPortDelReq { repeated int64 ids = 1; }
 message VpnServerPortListReq {
   Page page = 1;
   VpnServerPortVo vo = 2;
-  repeated int64 srcServerIds = 3;
-  repeated uint32 srcPorts = 4;
-  repeated int64 dstServerIds = 5;
+  repeated int64 excludeIds = 3;
+  repeated int64 srcServerIds = 4;
+  repeated uint32 srcPorts = 5;
+  repeated int64 dstServerIds = 6;
 }
 message VpnServerPortListResp {
   int64 total = 1;
   repeated VpnServerPortVo list = 2;
 }
 
+message VpnServerPortBatchAddReq {
+  repeated VpnServerPortVo list = 1;
+}
+message VpnServerPortBatchAddResp {
+  int64 total = 1;
+  repeated VpnServerPortVo list = 2;
+}
+
 // govpn 模块,VPN相关服务
 service GoVpnClient {
   rpc Ping(Request) returns (Response);
@@ -3708,4 +3717,5 @@ service GoVpnClient {
   rpc VpnServerPortDel(VpnServerPortDelReq) returns (Empty);
   rpc VpnServerPortGet(VpnServerPortGetReq) returns (VpnServerPortGetResp);
   rpc VpnServerPortList(VpnServerPortListReq) returns (VpnServerPortListResp);
+  rpc VpnServerPortBatchAdd(VpnServerPortBatchAddReq) returns (VpnServerPortBatchAddResp);
 }

Разница между файлами не показана из-за своего большого размера
+ 979 - 860
pb/pb/gorpc.pb.go


+ 38 - 0
pb/pb/gorpc_grpc.pb.go

@@ -12765,6 +12765,7 @@ const (
 	GoVpnClient_VpnServerPortDel_FullMethodName                  = "/gorpc.GoVpnClient/VpnServerPortDel"
 	GoVpnClient_VpnServerPortGet_FullMethodName                  = "/gorpc.GoVpnClient/VpnServerPortGet"
 	GoVpnClient_VpnServerPortList_FullMethodName                 = "/gorpc.GoVpnClient/VpnServerPortList"
+	GoVpnClient_VpnServerPortBatchAdd_FullMethodName             = "/gorpc.GoVpnClient/VpnServerPortBatchAdd"
 )
 
 // GoVpnClientClient is the client API for GoVpnClient service.
@@ -12897,6 +12898,7 @@ type GoVpnClientClient interface {
 	VpnServerPortDel(ctx context.Context, in *VpnServerPortDelReq, opts ...grpc.CallOption) (*Empty, error)
 	VpnServerPortGet(ctx context.Context, in *VpnServerPortGetReq, opts ...grpc.CallOption) (*VpnServerPortGetResp, error)
 	VpnServerPortList(ctx context.Context, in *VpnServerPortListReq, opts ...grpc.CallOption) (*VpnServerPortListResp, error)
+	VpnServerPortBatchAdd(ctx context.Context, in *VpnServerPortBatchAddReq, opts ...grpc.CallOption) (*VpnServerPortBatchAddResp, error)
 }
 
 type goVpnClientClient struct {
@@ -13927,6 +13929,16 @@ func (c *goVpnClientClient) VpnServerPortList(ctx context.Context, in *VpnServer
 	return out, nil
 }
 
+func (c *goVpnClientClient) VpnServerPortBatchAdd(ctx context.Context, in *VpnServerPortBatchAddReq, opts ...grpc.CallOption) (*VpnServerPortBatchAddResp, error) {
+	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+	out := new(VpnServerPortBatchAddResp)
+	err := c.cc.Invoke(ctx, GoVpnClient_VpnServerPortBatchAdd_FullMethodName, in, out, cOpts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
 // GoVpnClientServer is the server API for GoVpnClient service.
 // All implementations must embed UnimplementedGoVpnClientServer
 // for forward compatibility.
@@ -14057,6 +14069,7 @@ type GoVpnClientServer interface {
 	VpnServerPortDel(context.Context, *VpnServerPortDelReq) (*Empty, error)
 	VpnServerPortGet(context.Context, *VpnServerPortGetReq) (*VpnServerPortGetResp, error)
 	VpnServerPortList(context.Context, *VpnServerPortListReq) (*VpnServerPortListResp, error)
+	VpnServerPortBatchAdd(context.Context, *VpnServerPortBatchAddReq) (*VpnServerPortBatchAddResp, error)
 	mustEmbedUnimplementedGoVpnClientServer()
 }
 
@@ -14373,6 +14386,9 @@ func (UnimplementedGoVpnClientServer) VpnServerPortGet(context.Context, *VpnServ
 func (UnimplementedGoVpnClientServer) VpnServerPortList(context.Context, *VpnServerPortListReq) (*VpnServerPortListResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method VpnServerPortList not implemented")
 }
+func (UnimplementedGoVpnClientServer) VpnServerPortBatchAdd(context.Context, *VpnServerPortBatchAddReq) (*VpnServerPortBatchAddResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method VpnServerPortBatchAdd not implemented")
+}
 func (UnimplementedGoVpnClientServer) mustEmbedUnimplementedGoVpnClientServer() {}
 func (UnimplementedGoVpnClientServer) testEmbeddedByValue()                     {}
 
@@ -16230,6 +16246,24 @@ func _GoVpnClient_VpnServerPortList_Handler(srv interface{}, ctx context.Context
 	return interceptor(ctx, in, info, handler)
 }
 
+func _GoVpnClient_VpnServerPortBatchAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(VpnServerPortBatchAddReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(GoVpnClientServer).VpnServerPortBatchAdd(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: GoVpnClient_VpnServerPortBatchAdd_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(GoVpnClientServer).VpnServerPortBatchAdd(ctx, req.(*VpnServerPortBatchAddReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
 // GoVpnClient_ServiceDesc is the grpc.ServiceDesc for GoVpnClient service.
 // It's only intended for direct use with grpc.RegisterService,
 // and not to be introspected or modified (even as a copy)
@@ -16645,6 +16679,10 @@ var GoVpnClient_ServiceDesc = grpc.ServiceDesc{
 			MethodName: "VpnServerPortList",
 			Handler:    _GoVpnClient_VpnServerPortList_Handler,
 		},
+		{
+			MethodName: "VpnServerPortBatchAdd",
+			Handler:    _GoVpnClient_VpnServerPortBatchAdd_Handler,
+		},
 	},
 	Streams:  []grpc.StreamDesc{},
 	Metadata: "gorpc.proto",

+ 13 - 3
pb/vpn.proto

@@ -651,15 +651,24 @@ message VpnServerPortDelReq { repeated int64 ids = 1; }
 message VpnServerPortListReq {
   Page page = 1;
   VpnServerPortVo vo = 2;
-  repeated int64 srcServerIds = 3;
-  repeated uint32 srcPorts = 4;
-  repeated int64 dstServerIds = 5;
+  repeated int64 excludeIds = 3;
+  repeated int64 srcServerIds = 4;
+  repeated uint32 srcPorts = 5;
+  repeated int64 dstServerIds = 6;
 }
 message VpnServerPortListResp {
   int64 total = 1;
   repeated VpnServerPortVo list = 2;
 }
 
+message VpnServerPortBatchAddReq {
+  repeated VpnServerPortVo list = 1;
+}
+message VpnServerPortBatchAddResp {
+  int64 total = 1;
+  repeated VpnServerPortVo list = 2;
+}
+
 // govpn 模块,VPN相关服务
 service GoVpnClient {
   rpc Ping(Request) returns (Response);
@@ -816,4 +825,5 @@ service GoVpnClient {
   rpc VpnServerPortDel(VpnServerPortDelReq) returns (Empty);
   rpc VpnServerPortGet(VpnServerPortGetReq) returns (VpnServerPortGetResp);
   rpc VpnServerPortList(VpnServerPortListReq) returns (VpnServerPortListResp);
+  rpc VpnServerPortBatchAdd(VpnServerPortBatchAddReq) returns (VpnServerPortBatchAddResp);
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов