From 72826efbd13c22f4f919161c4b53813c9dbbd3b3 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 6 Sep 2021 09:16:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E7=9B=91=E6=8E=A7=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E4=B8=8A=E4=BC=A0=E7=9B=91=E6=8E=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/reporterconfigs/tasks.go | 23 + pkg/rpc/pb/model_report_result.pb.go | 224 +++++++ pkg/rpc/pb/service_report_node.pb.go | 300 +++++++-- pkg/rpc/pb/service_report_result.pb.go | 579 ++++++++++++++++++ .../protos/models/model_report_result.proto | 16 + pkg/rpc/protos/service_report_node.proto | 12 + pkg/rpc/protos/service_report_result.proto | 42 ++ 7 files changed, 1128 insertions(+), 68 deletions(-) create mode 100644 pkg/reporterconfigs/tasks.go create mode 100644 pkg/rpc/pb/model_report_result.pb.go create mode 100644 pkg/rpc/pb/service_report_result.pb.go create mode 100644 pkg/rpc/protos/models/model_report_result.proto create mode 100644 pkg/rpc/protos/service_report_result.proto diff --git a/pkg/reporterconfigs/tasks.go b/pkg/reporterconfigs/tasks.go new file mode 100644 index 0000000..6aac0cc --- /dev/null +++ b/pkg/reporterconfigs/tasks.go @@ -0,0 +1,23 @@ +// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. + +package reporterconfigs + +type TaskType = string + +const ( + TaskTypeIPAddr TaskType = "ipAddr" +) + +type IPTask struct { + AddrId int64 `json:"addrId"` + IP string `json:"ip"` + Port int `json:"port"` +} + +func FindTaskTypeName(taskType TaskType) string { + switch taskType { + case TaskTypeIPAddr: + return "IP地址" + } + return "" +} diff --git a/pkg/rpc/pb/model_report_result.pb.go b/pkg/rpc/pb/model_report_result.pb.go new file mode 100644 index 0000000..fb75508 --- /dev/null +++ b/pkg/rpc/pb/model_report_result.pb.go @@ -0,0 +1,224 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: models/model_report_result.proto + +package pb + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ReportResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + TargetId int64 `protobuf:"varint,3,opt,name=targetId,proto3" json:"targetId,omitempty"` + TargetDesc string `protobuf:"bytes,4,opt,name=targetDesc,proto3" json:"targetDesc,omitempty"` + ReportNodeId int64 `protobuf:"varint,5,opt,name=reportNodeId,proto3" json:"reportNodeId,omitempty"` + IsOk bool `protobuf:"varint,6,opt,name=isOk,proto3" json:"isOk,omitempty"` + CostMs float32 `protobuf:"fixed32,7,opt,name=costMs,proto3" json:"costMs,omitempty"` + Error string `protobuf:"bytes,8,opt,name=error,proto3" json:"error,omitempty"` + UpdatedAt int64 `protobuf:"varint,9,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` +} + +func (x *ReportResult) Reset() { + *x = ReportResult{} + if protoimpl.UnsafeEnabled { + mi := &file_models_model_report_result_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportResult) ProtoMessage() {} + +func (x *ReportResult) ProtoReflect() protoreflect.Message { + mi := &file_models_model_report_result_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportResult.ProtoReflect.Descriptor instead. +func (*ReportResult) Descriptor() ([]byte, []int) { + return file_models_model_report_result_proto_rawDescGZIP(), []int{0} +} + +func (x *ReportResult) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ReportResult) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ReportResult) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +func (x *ReportResult) GetTargetDesc() string { + if x != nil { + return x.TargetDesc + } + return "" +} + +func (x *ReportResult) GetReportNodeId() int64 { + if x != nil { + return x.ReportNodeId + } + return 0 +} + +func (x *ReportResult) GetIsOk() bool { + if x != nil { + return x.IsOk + } + return false +} + +func (x *ReportResult) GetCostMs() float32 { + if x != nil { + return x.CostMs + } + return 0 +} + +func (x *ReportResult) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *ReportResult) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +var File_models_model_report_result_proto protoreflect.FileDescriptor + +var file_models_model_report_result_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x44, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, + 0x73, 0x4f, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x73, 0x74, 0x4d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x06, 0x63, 0x6f, 0x73, 0x74, 0x4d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1c, 0x0a, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_model_report_result_proto_rawDescOnce sync.Once + file_models_model_report_result_proto_rawDescData = file_models_model_report_result_proto_rawDesc +) + +func file_models_model_report_result_proto_rawDescGZIP() []byte { + file_models_model_report_result_proto_rawDescOnce.Do(func() { + file_models_model_report_result_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_report_result_proto_rawDescData) + }) + return file_models_model_report_result_proto_rawDescData +} + +var file_models_model_report_result_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_models_model_report_result_proto_goTypes = []interface{}{ + (*ReportResult)(nil), // 0: pb.ReportResult +} +var file_models_model_report_result_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_models_model_report_result_proto_init() } +func file_models_model_report_result_proto_init() { + if File_models_model_report_result_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_model_report_result_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_model_report_result_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_model_report_result_proto_goTypes, + DependencyIndexes: file_models_model_report_result_proto_depIdxs, + MessageInfos: file_models_model_report_result_proto_msgTypes, + }.Build() + File_models_model_report_result_proto = out.File + file_models_model_report_result_proto_rawDesc = nil + file_models_model_report_result_proto_goTypes = nil + file_models_model_report_result_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/service_report_node.pb.go b/pkg/rpc/pb/service_report_node.pb.go index 067bef2..4d10e2e 100644 --- a/pkg/rpc/pb/service_report_node.pb.go +++ b/pkg/rpc/pb/service_report_node.pb.go @@ -768,6 +768,92 @@ func (x *FindCurrentReportNodeConfigResponse) GetReportNodeJSON() []byte { return nil } +// 读取任务 +type FindReportNodeTasksRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FindReportNodeTasksRequest) Reset() { + *x = FindReportNodeTasksRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_node_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindReportNodeTasksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindReportNodeTasksRequest) ProtoMessage() {} + +func (x *FindReportNodeTasksRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_report_node_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindReportNodeTasksRequest.ProtoReflect.Descriptor instead. +func (*FindReportNodeTasksRequest) Descriptor() ([]byte, []int) { + return file_service_report_node_proto_rawDescGZIP(), []int{13} +} + +type FindReportNodeTasksResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpAddrTasksJSON []byte `protobuf:"bytes,1,opt,name=ipAddrTasksJSON,proto3" json:"ipAddrTasksJSON,omitempty"` +} + +func (x *FindReportNodeTasksResponse) Reset() { + *x = FindReportNodeTasksResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_node_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindReportNodeTasksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindReportNodeTasksResponse) ProtoMessage() {} + +func (x *FindReportNodeTasksResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_report_node_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindReportNodeTasksResponse.ProtoReflect.Descriptor instead. +func (*FindReportNodeTasksResponse) Descriptor() ([]byte, []int) { + return file_service_report_node_proto_rawDescGZIP(), []int{14} +} + +func (x *FindReportNodeTasksResponse) GetIpAddrTasksJSON() []byte { + if x != nil { + return x.IpAddrTasksJSON + } + return nil +} + var File_service_report_node_proto protoreflect.FileDescriptor var file_service_report_node_proto_rawDesc = []byte{ @@ -853,57 +939,69 @@ var file_service_report_node_proto_rawDesc = []byte{ 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0x8d, 0x06, - 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x1c, 0x0a, + 0x1a, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x54, + 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x47, 0x0a, 0x1b, 0x46, + 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x61, 0x73, + 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x69, 0x70, + 0x41, 0x64, 0x64, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x69, 0x70, 0x41, 0x64, 0x64, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x73, + 0x4a, 0x53, 0x4f, 0x4e, 0x32, 0xe5, 0x06, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1b, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x2e, + 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1b, + 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, 0x1a, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x66, 0x69, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x12, 0x59, 0x0a, 0x1a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, - 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5f, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5c, 0x0a, 0x15, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x46, - 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, - 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, - 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, - 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, 0x30, 0x01, - 0x12, 0x4b, 0x0a, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, - 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x6e, 0x0a, - 0x1b, 0x66, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x65, 0x73, 0x73, 0x12, 0x6e, 0x0a, 0x1b, 0x66, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, + 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x1e, 0x2e, 0x70, 0x62, + 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x54, + 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, + 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x54, + 0x61, 0x73, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -918,7 +1016,7 @@ func file_service_report_node_proto_rawDescGZIP() []byte { return file_service_report_node_proto_rawDescData } -var file_service_report_node_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_service_report_node_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_service_report_node_proto_goTypes = []interface{}{ (*CreateReportNodeRequest)(nil), // 0: pb.CreateReportNodeRequest (*CreateReportNodeResponse)(nil), // 1: pb.CreateReportNodeResponse @@ -933,13 +1031,15 @@ var file_service_report_node_proto_goTypes = []interface{}{ (*UpdateReportNodeStatusRequest)(nil), // 10: pb.UpdateReportNodeStatusRequest (*FindCurrentReportNodeConfigRequest)(nil), // 11: pb.FindCurrentReportNodeConfigRequest (*FindCurrentReportNodeConfigResponse)(nil), // 12: pb.FindCurrentReportNodeConfigResponse - (*ReportNode)(nil), // 13: pb.ReportNode - (*RPCSuccess)(nil), // 14: pb.RPCSuccess - (*RPCCountResponse)(nil), // 15: pb.RPCCountResponse + (*FindReportNodeTasksRequest)(nil), // 13: pb.FindReportNodeTasksRequest + (*FindReportNodeTasksResponse)(nil), // 14: pb.FindReportNodeTasksResponse + (*ReportNode)(nil), // 15: pb.ReportNode + (*RPCSuccess)(nil), // 16: pb.RPCSuccess + (*RPCCountResponse)(nil), // 17: pb.RPCCountResponse } var file_service_report_node_proto_depIdxs = []int32{ - 13, // 0: pb.ListEnabledReportNodesResponse.reportNodes:type_name -> pb.ReportNode - 13, // 1: pb.FindEnabledReportNodeResponse.reportNode:type_name -> pb.ReportNode + 15, // 0: pb.ListEnabledReportNodesResponse.reportNodes:type_name -> pb.ReportNode + 15, // 1: pb.FindEnabledReportNodeResponse.reportNode:type_name -> pb.ReportNode 0, // 2: pb.ReportNodeService.createReportNode:input_type -> pb.CreateReportNodeRequest 2, // 3: pb.ReportNodeService.deleteReportNode:input_type -> pb.DeleteReportNodeRequest 3, // 4: pb.ReportNodeService.updateReportNode:input_type -> pb.UpdateReportNodeRequest @@ -949,17 +1049,19 @@ var file_service_report_node_proto_depIdxs = []int32{ 9, // 8: pb.ReportNodeService.reportNodeStream:input_type -> pb.ReportNodeStreamMessage 10, // 9: pb.ReportNodeService.updateReportNodeStatus:input_type -> pb.UpdateReportNodeStatusRequest 11, // 10: pb.ReportNodeService.findCurrentReportNodeConfig:input_type -> pb.FindCurrentReportNodeConfigRequest - 1, // 11: pb.ReportNodeService.createReportNode:output_type -> pb.CreateReportNodeResponse - 14, // 12: pb.ReportNodeService.deleteReportNode:output_type -> pb.RPCSuccess - 14, // 13: pb.ReportNodeService.updateReportNode:output_type -> pb.RPCSuccess - 15, // 14: pb.ReportNodeService.countAllEnabledReportNodes:output_type -> pb.RPCCountResponse - 6, // 15: pb.ReportNodeService.listEnabledReportNodes:output_type -> pb.ListEnabledReportNodesResponse - 8, // 16: pb.ReportNodeService.findEnabledReportNode:output_type -> pb.FindEnabledReportNodeResponse - 9, // 17: pb.ReportNodeService.reportNodeStream:output_type -> pb.ReportNodeStreamMessage - 14, // 18: pb.ReportNodeService.updateReportNodeStatus:output_type -> pb.RPCSuccess - 12, // 19: pb.ReportNodeService.findCurrentReportNodeConfig:output_type -> pb.FindCurrentReportNodeConfigResponse - 11, // [11:20] is the sub-list for method output_type - 2, // [2:11] is the sub-list for method input_type + 13, // 11: pb.ReportNodeService.findReportNodeTasks:input_type -> pb.FindReportNodeTasksRequest + 1, // 12: pb.ReportNodeService.createReportNode:output_type -> pb.CreateReportNodeResponse + 16, // 13: pb.ReportNodeService.deleteReportNode:output_type -> pb.RPCSuccess + 16, // 14: pb.ReportNodeService.updateReportNode:output_type -> pb.RPCSuccess + 17, // 15: pb.ReportNodeService.countAllEnabledReportNodes:output_type -> pb.RPCCountResponse + 6, // 16: pb.ReportNodeService.listEnabledReportNodes:output_type -> pb.ListEnabledReportNodesResponse + 8, // 17: pb.ReportNodeService.findEnabledReportNode:output_type -> pb.FindEnabledReportNodeResponse + 9, // 18: pb.ReportNodeService.reportNodeStream:output_type -> pb.ReportNodeStreamMessage + 16, // 19: pb.ReportNodeService.updateReportNodeStatus:output_type -> pb.RPCSuccess + 12, // 20: pb.ReportNodeService.findCurrentReportNodeConfig:output_type -> pb.FindCurrentReportNodeConfigResponse + 14, // 21: pb.ReportNodeService.findReportNodeTasks:output_type -> pb.FindReportNodeTasksResponse + 12, // [12:22] is the sub-list for method output_type + 2, // [2:12] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -1129,6 +1231,30 @@ func file_service_report_node_proto_init() { return nil } } + file_service_report_node_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindReportNodeTasksRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_report_node_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindReportNodeTasksResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1136,7 +1262,7 @@ func file_service_report_node_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_report_node_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, @@ -1180,6 +1306,8 @@ type ReportNodeServiceClient interface { UpdateReportNodeStatus(ctx context.Context, in *UpdateReportNodeStatusRequest, opts ...grpc.CallOption) (*RPCSuccess, error) // 获取当前节点信息 FindCurrentReportNodeConfig(ctx context.Context, in *FindCurrentReportNodeConfigRequest, opts ...grpc.CallOption) (*FindCurrentReportNodeConfigResponse, error) + // 读取任务 + FindReportNodeTasks(ctx context.Context, in *FindReportNodeTasksRequest, opts ...grpc.CallOption) (*FindReportNodeTasksResponse, error) } type reportNodeServiceClient struct { @@ -1293,6 +1421,15 @@ func (c *reportNodeServiceClient) FindCurrentReportNodeConfig(ctx context.Contex return out, nil } +func (c *reportNodeServiceClient) FindReportNodeTasks(ctx context.Context, in *FindReportNodeTasksRequest, opts ...grpc.CallOption) (*FindReportNodeTasksResponse, error) { + out := new(FindReportNodeTasksResponse) + err := c.cc.Invoke(ctx, "/pb.ReportNodeService/findReportNodeTasks", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ReportNodeServiceServer is the server API for ReportNodeService service. type ReportNodeServiceServer interface { // 添加终端 @@ -1313,6 +1450,8 @@ type ReportNodeServiceServer interface { UpdateReportNodeStatus(context.Context, *UpdateReportNodeStatusRequest) (*RPCSuccess, error) // 获取当前节点信息 FindCurrentReportNodeConfig(context.Context, *FindCurrentReportNodeConfigRequest) (*FindCurrentReportNodeConfigResponse, error) + // 读取任务 + FindReportNodeTasks(context.Context, *FindReportNodeTasksRequest) (*FindReportNodeTasksResponse, error) } // UnimplementedReportNodeServiceServer can be embedded to have forward compatible implementations. @@ -1346,6 +1485,9 @@ func (*UnimplementedReportNodeServiceServer) UpdateReportNodeStatus(context.Cont func (*UnimplementedReportNodeServiceServer) FindCurrentReportNodeConfig(context.Context, *FindCurrentReportNodeConfigRequest) (*FindCurrentReportNodeConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FindCurrentReportNodeConfig not implemented") } +func (*UnimplementedReportNodeServiceServer) FindReportNodeTasks(context.Context, *FindReportNodeTasksRequest) (*FindReportNodeTasksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindReportNodeTasks not implemented") +} func RegisterReportNodeServiceServer(s *grpc.Server, srv ReportNodeServiceServer) { s.RegisterService(&_ReportNodeService_serviceDesc, srv) @@ -1521,6 +1663,24 @@ func _ReportNodeService_FindCurrentReportNodeConfig_Handler(srv interface{}, ctx return interceptor(ctx, in, info, handler) } +func _ReportNodeService_FindReportNodeTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindReportNodeTasksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportNodeServiceServer).FindReportNodeTasks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.ReportNodeService/FindReportNodeTasks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportNodeServiceServer).FindReportNodeTasks(ctx, req.(*FindReportNodeTasksRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _ReportNodeService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.ReportNodeService", HandlerType: (*ReportNodeServiceServer)(nil), @@ -1557,6 +1717,10 @@ var _ReportNodeService_serviceDesc = grpc.ServiceDesc{ MethodName: "findCurrentReportNodeConfig", Handler: _ReportNodeService_FindCurrentReportNodeConfig_Handler, }, + { + MethodName: "findReportNodeTasks", + Handler: _ReportNodeService_FindReportNodeTasks_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/pkg/rpc/pb/service_report_result.pb.go b/pkg/rpc/pb/service_report_result.pb.go new file mode 100644 index 0000000..7f50c86 --- /dev/null +++ b/pkg/rpc/pb/service_report_result.pb.go @@ -0,0 +1,579 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_report_result.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// 计算监控结果数量 +type CountAllReportResultsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportNodeId int64 `protobuf:"varint,1,opt,name=reportNodeId,proto3" json:"reportNodeId,omitempty"` + OkState int32 `protobuf:"varint,2,opt,name=okState,proto3" json:"okState,omitempty"` +} + +func (x *CountAllReportResultsRequest) Reset() { + *x = CountAllReportResultsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_result_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllReportResultsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllReportResultsRequest) ProtoMessage() {} + +func (x *CountAllReportResultsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_report_result_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountAllReportResultsRequest.ProtoReflect.Descriptor instead. +func (*CountAllReportResultsRequest) Descriptor() ([]byte, []int) { + return file_service_report_result_proto_rawDescGZIP(), []int{0} +} + +func (x *CountAllReportResultsRequest) GetReportNodeId() int64 { + if x != nil { + return x.ReportNodeId + } + return 0 +} + +func (x *CountAllReportResultsRequest) GetOkState() int32 { + if x != nil { + return x.OkState + } + return 0 +} + +// 列出单页监控结果 +type ListReportResultsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportNodeId int64 `protobuf:"varint,1,opt,name=reportNodeId,proto3" json:"reportNodeId,omitempty"` + OkState int32 `protobuf:"varint,2,opt,name=okState,proto3" json:"okState,omitempty"` + Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListReportResultsRequest) Reset() { + *x = ListReportResultsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_result_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReportResultsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReportResultsRequest) ProtoMessage() {} + +func (x *ListReportResultsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_report_result_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListReportResultsRequest.ProtoReflect.Descriptor instead. +func (*ListReportResultsRequest) Descriptor() ([]byte, []int) { + return file_service_report_result_proto_rawDescGZIP(), []int{1} +} + +func (x *ListReportResultsRequest) GetReportNodeId() int64 { + if x != nil { + return x.ReportNodeId + } + return 0 +} + +func (x *ListReportResultsRequest) GetOkState() int32 { + if x != nil { + return x.OkState + } + return 0 +} + +func (x *ListReportResultsRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListReportResultsRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListReportResultsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportResults []*ReportResult `protobuf:"bytes,1,rep,name=reportResults,proto3" json:"reportResults,omitempty"` +} + +func (x *ListReportResultsResponse) Reset() { + *x = ListReportResultsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_result_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReportResultsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReportResultsResponse) ProtoMessage() {} + +func (x *ListReportResultsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_report_result_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListReportResultsResponse.ProtoReflect.Descriptor instead. +func (*ListReportResultsResponse) Descriptor() ([]byte, []int) { + return file_service_report_result_proto_rawDescGZIP(), []int{2} +} + +func (x *ListReportResultsResponse) GetReportResults() []*ReportResult { + if x != nil { + return x.ReportResults + } + return nil +} + +// 上传报告结果 +type UpdateReportResultsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportResults []*ReportResult `protobuf:"bytes,1,rep,name=reportResults,proto3" json:"reportResults,omitempty"` +} + +func (x *UpdateReportResultsRequest) Reset() { + *x = UpdateReportResultsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_result_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateReportResultsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateReportResultsRequest) ProtoMessage() {} + +func (x *UpdateReportResultsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_report_result_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateReportResultsRequest.ProtoReflect.Descriptor instead. +func (*UpdateReportResultsRequest) Descriptor() ([]byte, []int) { + return file_service_report_result_proto_rawDescGZIP(), []int{3} +} + +func (x *UpdateReportResultsRequest) GetReportResults() []*ReportResult { + if x != nil { + return x.ReportResults + } + return nil +} + +var File_service_report_result_proto protoreflect.FileDescriptor + +var file_service_report_result_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, + 0x62, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, + 0x0a, 0x1c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, + 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x84, 0x01, 0x0a, + 0x18, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x6f, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x6f, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x22, 0x53, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x36, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, + 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x32, 0xff, + 0x01, 0x0a, 0x13, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4f, 0x0a, 0x15, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, + 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x1c, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x13, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, + 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_service_report_result_proto_rawDescOnce sync.Once + file_service_report_result_proto_rawDescData = file_service_report_result_proto_rawDesc +) + +func file_service_report_result_proto_rawDescGZIP() []byte { + file_service_report_result_proto_rawDescOnce.Do(func() { + file_service_report_result_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_report_result_proto_rawDescData) + }) + return file_service_report_result_proto_rawDescData +} + +var file_service_report_result_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_service_report_result_proto_goTypes = []interface{}{ + (*CountAllReportResultsRequest)(nil), // 0: pb.CountAllReportResultsRequest + (*ListReportResultsRequest)(nil), // 1: pb.ListReportResultsRequest + (*ListReportResultsResponse)(nil), // 2: pb.ListReportResultsResponse + (*UpdateReportResultsRequest)(nil), // 3: pb.UpdateReportResultsRequest + (*ReportResult)(nil), // 4: pb.ReportResult + (*RPCCountResponse)(nil), // 5: pb.RPCCountResponse + (*RPCSuccess)(nil), // 6: pb.RPCSuccess +} +var file_service_report_result_proto_depIdxs = []int32{ + 4, // 0: pb.ListReportResultsResponse.reportResults:type_name -> pb.ReportResult + 4, // 1: pb.UpdateReportResultsRequest.reportResults:type_name -> pb.ReportResult + 0, // 2: pb.ReportResultService.countAllReportResults:input_type -> pb.CountAllReportResultsRequest + 1, // 3: pb.ReportResultService.listReportResults:input_type -> pb.ListReportResultsRequest + 3, // 4: pb.ReportResultService.updateReportResults:input_type -> pb.UpdateReportResultsRequest + 5, // 5: pb.ReportResultService.countAllReportResults:output_type -> pb.RPCCountResponse + 2, // 6: pb.ReportResultService.listReportResults:output_type -> pb.ListReportResultsResponse + 6, // 7: pb.ReportResultService.updateReportResults:output_type -> pb.RPCSuccess + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_service_report_result_proto_init() } +func file_service_report_result_proto_init() { + if File_service_report_result_proto != nil { + return + } + file_models_rpc_messages_proto_init() + file_models_model_report_result_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_report_result_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllReportResultsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_report_result_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReportResultsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_report_result_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReportResultsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_report_result_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateReportResultsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_report_result_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_report_result_proto_goTypes, + DependencyIndexes: file_service_report_result_proto_depIdxs, + MessageInfos: file_service_report_result_proto_msgTypes, + }.Build() + File_service_report_result_proto = out.File + file_service_report_result_proto_rawDesc = nil + file_service_report_result_proto_goTypes = nil + file_service_report_result_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// ReportResultServiceClient is the client API for ReportResultService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ReportResultServiceClient interface { + // 计算监控结果数量 + CountAllReportResults(ctx context.Context, in *CountAllReportResultsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) + // 列出单页监控结果 + ListReportResults(ctx context.Context, in *ListReportResultsRequest, opts ...grpc.CallOption) (*ListReportResultsResponse, error) + // 上传报告结果 + UpdateReportResults(ctx context.Context, in *UpdateReportResultsRequest, opts ...grpc.CallOption) (*RPCSuccess, error) +} + +type reportResultServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewReportResultServiceClient(cc grpc.ClientConnInterface) ReportResultServiceClient { + return &reportResultServiceClient{cc} +} + +func (c *reportResultServiceClient) CountAllReportResults(ctx context.Context, in *CountAllReportResultsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) { + out := new(RPCCountResponse) + err := c.cc.Invoke(ctx, "/pb.ReportResultService/countAllReportResults", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reportResultServiceClient) ListReportResults(ctx context.Context, in *ListReportResultsRequest, opts ...grpc.CallOption) (*ListReportResultsResponse, error) { + out := new(ListReportResultsResponse) + err := c.cc.Invoke(ctx, "/pb.ReportResultService/listReportResults", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reportResultServiceClient) UpdateReportResults(ctx context.Context, in *UpdateReportResultsRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.ReportResultService/updateReportResults", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReportResultServiceServer is the server API for ReportResultService service. +type ReportResultServiceServer interface { + // 计算监控结果数量 + CountAllReportResults(context.Context, *CountAllReportResultsRequest) (*RPCCountResponse, error) + // 列出单页监控结果 + ListReportResults(context.Context, *ListReportResultsRequest) (*ListReportResultsResponse, error) + // 上传报告结果 + UpdateReportResults(context.Context, *UpdateReportResultsRequest) (*RPCSuccess, error) +} + +// UnimplementedReportResultServiceServer can be embedded to have forward compatible implementations. +type UnimplementedReportResultServiceServer struct { +} + +func (*UnimplementedReportResultServiceServer) CountAllReportResults(context.Context, *CountAllReportResultsRequest) (*RPCCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllReportResults not implemented") +} +func (*UnimplementedReportResultServiceServer) ListReportResults(context.Context, *ListReportResultsRequest) (*ListReportResultsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListReportResults not implemented") +} +func (*UnimplementedReportResultServiceServer) UpdateReportResults(context.Context, *UpdateReportResultsRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateReportResults not implemented") +} + +func RegisterReportResultServiceServer(s *grpc.Server, srv ReportResultServiceServer) { + s.RegisterService(&_ReportResultService_serviceDesc, srv) +} + +func _ReportResultService_CountAllReportResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllReportResultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportResultServiceServer).CountAllReportResults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.ReportResultService/CountAllReportResults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportResultServiceServer).CountAllReportResults(ctx, req.(*CountAllReportResultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReportResultService_ListReportResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReportResultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportResultServiceServer).ListReportResults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.ReportResultService/ListReportResults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportResultServiceServer).ListReportResults(ctx, req.(*ListReportResultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReportResultService_UpdateReportResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateReportResultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportResultServiceServer).UpdateReportResults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.ReportResultService/UpdateReportResults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportResultServiceServer).UpdateReportResults(ctx, req.(*UpdateReportResultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ReportResultService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ReportResultService", + HandlerType: (*ReportResultServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "countAllReportResults", + Handler: _ReportResultService_CountAllReportResults_Handler, + }, + { + MethodName: "listReportResults", + Handler: _ReportResultService_ListReportResults_Handler, + }, + { + MethodName: "updateReportResults", + Handler: _ReportResultService_UpdateReportResults_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_report_result.proto", +} diff --git a/pkg/rpc/protos/models/model_report_result.proto b/pkg/rpc/protos/models/model_report_result.proto new file mode 100644 index 0000000..006d7b3 --- /dev/null +++ b/pkg/rpc/protos/models/model_report_result.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +message ReportResult { + int64 id = 1; + string type = 2; + int64 targetId = 3; + string targetDesc = 4; + int64 reportNodeId = 5; + bool isOk = 6; + float costMs = 7; + string error = 8; + int64 updatedAt = 9; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_report_node.proto b/pkg/rpc/protos/service_report_node.proto index 70d82fd..42b6707 100644 --- a/pkg/rpc/protos/service_report_node.proto +++ b/pkg/rpc/protos/service_report_node.proto @@ -34,6 +34,9 @@ service ReportNodeService { // 获取当前节点信息 rpc findCurrentReportNodeConfig (FindCurrentReportNodeConfigRequest) returns (FindCurrentReportNodeConfigResponse); + + // 读取任务 + rpc findReportNodeTasks(FindReportNodeTasksRequest) returns (FindReportNodeTasksResponse); } // 添加终端 @@ -112,4 +115,13 @@ message FindCurrentReportNodeConfigRequest { message FindCurrentReportNodeConfigResponse { bytes reportNodeJSON = 1; +} + +// 读取任务 +message FindReportNodeTasksRequest { + +} + +message FindReportNodeTasksResponse { + bytes ipAddrTasksJSON = 1; } \ No newline at end of file diff --git a/pkg/rpc/protos/service_report_result.proto b/pkg/rpc/protos/service_report_result.proto new file mode 100644 index 0000000..83f3f9b --- /dev/null +++ b/pkg/rpc/protos/service_report_result.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/rpc_messages.proto"; +import "models/model_report_result.proto"; + +// 区域监控报告结果 +service ReportResultService { + // 计算监控结果数量 + rpc countAllReportResults(CountAllReportResultsRequest) returns (RPCCountResponse); + + // 列出单页监控结果 + rpc listReportResults(ListReportResultsRequest) returns (ListReportResultsResponse); + + // 上传报告结果 + rpc updateReportResults(UpdateReportResultsRequest) returns (RPCSuccess); +} + +// 计算监控结果数量 +message CountAllReportResultsRequest { + int64 reportNodeId = 1; + int32 okState = 2; +} + +// 列出单页监控结果 +message ListReportResultsRequest { + int64 reportNodeId = 1; + int32 okState = 2; + int64 offset = 3; + int64 size = 4; +} + +message ListReportResultsResponse { + repeated ReportResult reportResults = 1; +} + +// 上传报告结果 +message UpdateReportResultsRequest { + repeated ReportResult reportResults = 1; +} \ No newline at end of file