From b581dd46c01544075791b77d577a3dc2467778eb Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 15 Sep 2021 17:53:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E6=89=BE=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E7=9B=91=E6=8E=A7=E5=AF=B9=E8=B1=A1=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/rpc/pb/service_report_result.pb.go | 258 ++++++++++++++++++--- pkg/rpc/protos/service_report_result.proto | 15 +- 2 files changed, 236 insertions(+), 37 deletions(-) diff --git a/pkg/rpc/pb/service_report_result.pb.go b/pkg/rpc/pb/service_report_result.pb.go index d986803..ebf25ce 100644 --- a/pkg/rpc/pb/service_report_result.pb.go +++ b/pkg/rpc/pb/service_report_result.pb.go @@ -268,6 +268,109 @@ func (x *UpdateReportResultsRequest) GetReportResults() []*ReportResult { return nil } +// 查询某个对象的监控结果 +type FindAllReportResultsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + TargetId int64 `protobuf:"varint,2,opt,name=targetId,proto3" json:"targetId,omitempty"` +} + +func (x *FindAllReportResultsRequest) Reset() { + *x = FindAllReportResultsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_result_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllReportResultsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllReportResultsRequest) ProtoMessage() {} + +func (x *FindAllReportResultsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_report_result_proto_msgTypes[4] + 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 FindAllReportResultsRequest.ProtoReflect.Descriptor instead. +func (*FindAllReportResultsRequest) Descriptor() ([]byte, []int) { + return file_service_report_result_proto_rawDescGZIP(), []int{4} +} + +func (x *FindAllReportResultsRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *FindAllReportResultsRequest) GetTargetId() int64 { + if x != nil { + return x.TargetId + } + return 0 +} + +type FindAllReportResultsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportResults []*ReportResult `protobuf:"bytes,1,rep,name=reportResults,proto3" json:"reportResults,omitempty"` +} + +func (x *FindAllReportResultsResponse) Reset() { + *x = FindAllReportResultsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_report_result_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllReportResultsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllReportResultsResponse) ProtoMessage() {} + +func (x *FindAllReportResultsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_report_result_proto_msgTypes[5] + 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 FindAllReportResultsResponse.ProtoReflect.Descriptor instead. +func (*FindAllReportResultsResponse) Descriptor() ([]byte, []int) { + return file_service_report_result_proto_rawDescGZIP(), []int{5} +} + +func (x *FindAllReportResultsResponse) 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{ @@ -304,24 +407,40 @@ var file_service_report_result_proto_rawDesc = []byte{ 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, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x4d, 0x0a, 0x1b, 0x46, 0x69, + 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x22, 0x56, 0x0a, 0x1c, 0x46, 0x69, 0x6e, + 0x64, 0x41, 0x6c, 0x6c, 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, 0x32, 0xda, 0x02, 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, 0x12, 0x59, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, + 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 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 ( @@ -336,30 +455,35 @@ func file_service_report_result_proto_rawDescGZIP() []byte { return file_service_report_result_proto_rawDescData } -var file_service_report_result_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_service_report_result_proto_msgTypes = make([]protoimpl.MessageInfo, 6) 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 + (*FindAllReportResultsRequest)(nil), // 4: pb.FindAllReportResultsRequest + (*FindAllReportResultsResponse)(nil), // 5: pb.FindAllReportResultsResponse + (*ReportResult)(nil), // 6: pb.ReportResult + (*RPCCountResponse)(nil), // 7: pb.RPCCountResponse + (*RPCSuccess)(nil), // 8: 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 + 6, // 0: pb.ListReportResultsResponse.reportResults:type_name -> pb.ReportResult + 6, // 1: pb.UpdateReportResultsRequest.reportResults:type_name -> pb.ReportResult + 6, // 2: pb.FindAllReportResultsResponse.reportResults:type_name -> pb.ReportResult + 0, // 3: pb.ReportResultService.countAllReportResults:input_type -> pb.CountAllReportResultsRequest + 1, // 4: pb.ReportResultService.listReportResults:input_type -> pb.ListReportResultsRequest + 3, // 5: pb.ReportResultService.updateReportResults:input_type -> pb.UpdateReportResultsRequest + 4, // 6: pb.ReportResultService.findAllReportResults:input_type -> pb.FindAllReportResultsRequest + 7, // 7: pb.ReportResultService.countAllReportResults:output_type -> pb.RPCCountResponse + 2, // 8: pb.ReportResultService.listReportResults:output_type -> pb.ListReportResultsResponse + 8, // 9: pb.ReportResultService.updateReportResults:output_type -> pb.RPCSuccess + 5, // 10: pb.ReportResultService.findAllReportResults:output_type -> pb.FindAllReportResultsResponse + 7, // [7:11] is the sub-list for method output_type + 3, // [3:7] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_service_report_result_proto_init() } @@ -418,6 +542,30 @@ func file_service_report_result_proto_init() { return nil } } + file_service_report_result_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllReportResultsRequest); 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[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllReportResultsResponse); 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{ @@ -425,7 +573,7 @@ func file_service_report_result_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_report_result_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, @@ -457,6 +605,8 @@ type ReportResultServiceClient interface { ListReportResults(ctx context.Context, in *ListReportResultsRequest, opts ...grpc.CallOption) (*ListReportResultsResponse, error) // 上传报告结果 UpdateReportResults(ctx context.Context, in *UpdateReportResultsRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 查询某个对象的监控结果 + FindAllReportResults(ctx context.Context, in *FindAllReportResultsRequest, opts ...grpc.CallOption) (*FindAllReportResultsResponse, error) } type reportResultServiceClient struct { @@ -494,6 +644,15 @@ func (c *reportResultServiceClient) UpdateReportResults(ctx context.Context, in return out, nil } +func (c *reportResultServiceClient) FindAllReportResults(ctx context.Context, in *FindAllReportResultsRequest, opts ...grpc.CallOption) (*FindAllReportResultsResponse, error) { + out := new(FindAllReportResultsResponse) + err := c.cc.Invoke(ctx, "/pb.ReportResultService/findAllReportResults", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ReportResultServiceServer is the server API for ReportResultService service. type ReportResultServiceServer interface { // 计算监控结果数量 @@ -502,6 +661,8 @@ type ReportResultServiceServer interface { ListReportResults(context.Context, *ListReportResultsRequest) (*ListReportResultsResponse, error) // 上传报告结果 UpdateReportResults(context.Context, *UpdateReportResultsRequest) (*RPCSuccess, error) + // 查询某个对象的监控结果 + FindAllReportResults(context.Context, *FindAllReportResultsRequest) (*FindAllReportResultsResponse, error) } // UnimplementedReportResultServiceServer can be embedded to have forward compatible implementations. @@ -517,6 +678,9 @@ func (*UnimplementedReportResultServiceServer) ListReportResults(context.Context func (*UnimplementedReportResultServiceServer) UpdateReportResults(context.Context, *UpdateReportResultsRequest) (*RPCSuccess, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateReportResults not implemented") } +func (*UnimplementedReportResultServiceServer) FindAllReportResults(context.Context, *FindAllReportResultsRequest) (*FindAllReportResultsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindAllReportResults not implemented") +} func RegisterReportResultServiceServer(s *grpc.Server, srv ReportResultServiceServer) { s.RegisterService(&_ReportResultService_serviceDesc, srv) @@ -576,6 +740,24 @@ func _ReportResultService_UpdateReportResults_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } +func _ReportResultService_FindAllReportResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindAllReportResultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReportResultServiceServer).FindAllReportResults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.ReportResultService/FindAllReportResults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReportResultServiceServer).FindAllReportResults(ctx, req.(*FindAllReportResultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _ReportResultService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.ReportResultService", HandlerType: (*ReportResultServiceServer)(nil), @@ -592,6 +774,10 @@ var _ReportResultService_serviceDesc = grpc.ServiceDesc{ MethodName: "updateReportResults", Handler: _ReportResultService_UpdateReportResults_Handler, }, + { + MethodName: "findAllReportResults", + Handler: _ReportResultService_FindAllReportResults_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_report_result.proto", diff --git a/pkg/rpc/protos/service_report_result.proto b/pkg/rpc/protos/service_report_result.proto index 5c99872..8264136 100644 --- a/pkg/rpc/protos/service_report_result.proto +++ b/pkg/rpc/protos/service_report_result.proto @@ -16,6 +16,9 @@ service ReportResultService { // 上传报告结果 rpc updateReportResults(UpdateReportResultsRequest) returns (RPCSuccess); + + // 查询某个对象的监控结果 + rpc findAllReportResults(FindAllReportResultsRequest) returns (FindAllReportResultsResponse); } // 计算监控结果数量 @@ -41,4 +44,14 @@ message ListReportResultsResponse { // 上传报告结果 message UpdateReportResultsRequest { repeated ReportResult reportResults = 1; -} \ No newline at end of file +} + +// 查询某个对象的监控结果 +message FindAllReportResultsRequest { + string type = 1; + int64 targetId = 2; +} + +message FindAllReportResultsResponse { + repeated ReportResult reportResults = 1; +}