diff --git a/pkg/rpc/pb/model_metric_chart.pb.go b/pkg/rpc/pb/model_metric_chart.pb.go new file mode 100644 index 0000000..edfc2fc --- /dev/null +++ b/pkg/rpc/pb/model_metric_chart.pb.go @@ -0,0 +1,221 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: models/model_metric_chart.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 MetricChart struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + WidthDiv int32 `protobuf:"varint,4,opt,name=widthDiv,proto3" json:"widthDiv,omitempty"` + ParamsJSON []byte `protobuf:"bytes,5,opt,name=paramsJSON,proto3" json:"paramsJSON,omitempty"` + IsOn bool `protobuf:"varint,6,opt,name=isOn,proto3" json:"isOn,omitempty"` + MaxItems int32 `protobuf:"varint,7,opt,name=maxItems,proto3" json:"maxItems,omitempty"` + MetricItem *MetricItem `protobuf:"bytes,30,opt,name=metricItem,proto3" json:"metricItem,omitempty"` +} + +func (x *MetricChart) Reset() { + *x = MetricChart{} + if protoimpl.UnsafeEnabled { + mi := &file_models_model_metric_chart_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricChart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricChart) ProtoMessage() {} + +func (x *MetricChart) ProtoReflect() protoreflect.Message { + mi := &file_models_model_metric_chart_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 MetricChart.ProtoReflect.Descriptor instead. +func (*MetricChart) Descriptor() ([]byte, []int) { + return file_models_model_metric_chart_proto_rawDescGZIP(), []int{0} +} + +func (x *MetricChart) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *MetricChart) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MetricChart) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *MetricChart) GetWidthDiv() int32 { + if x != nil { + return x.WidthDiv + } + return 0 +} + +func (x *MetricChart) GetParamsJSON() []byte { + if x != nil { + return x.ParamsJSON + } + return nil +} + +func (x *MetricChart) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *MetricChart) GetMaxItems() int32 { + if x != nil { + return x.MaxItems + } + return 0 +} + +func (x *MetricChart) GetMetricItem() *MetricItem { + if x != nil { + return x.MetricItem + } + return nil +} + +var File_models_model_metric_chart_proto protoreflect.FileDescriptor + +var file_models_model_metric_chart_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x77, 0x69, 0x64, 0x74, 0x68, 0x44, 0x69, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x77, 0x69, 0x64, 0x74, 0x68, 0x44, 0x69, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x1a, 0x0a, + 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2e, 0x0a, 0x0a, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_model_metric_chart_proto_rawDescOnce sync.Once + file_models_model_metric_chart_proto_rawDescData = file_models_model_metric_chart_proto_rawDesc +) + +func file_models_model_metric_chart_proto_rawDescGZIP() []byte { + file_models_model_metric_chart_proto_rawDescOnce.Do(func() { + file_models_model_metric_chart_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_metric_chart_proto_rawDescData) + }) + return file_models_model_metric_chart_proto_rawDescData +} + +var file_models_model_metric_chart_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_models_model_metric_chart_proto_goTypes = []interface{}{ + (*MetricChart)(nil), // 0: pb.MetricChart + (*MetricItem)(nil), // 1: pb.MetricItem +} +var file_models_model_metric_chart_proto_depIdxs = []int32{ + 1, // 0: pb.MetricChart.metricItem:type_name -> pb.MetricItem + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_models_model_metric_chart_proto_init() } +func file_models_model_metric_chart_proto_init() { + if File_models_model_metric_chart_proto != nil { + return + } + file_models_model_metric_item_proto_init() + if !protoimpl.UnsafeEnabled { + file_models_model_metric_chart_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricChart); 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_metric_chart_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_model_metric_chart_proto_goTypes, + DependencyIndexes: file_models_model_metric_chart_proto_depIdxs, + MessageInfos: file_models_model_metric_chart_proto_msgTypes, + }.Build() + File_models_model_metric_chart_proto = out.File + file_models_model_metric_chart_proto_rawDesc = nil + file_models_model_metric_chart_proto_goTypes = nil + file_models_model_metric_chart_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/service_metric_chart.pb.go b/pkg/rpc/pb/service_metric_chart.pb.go new file mode 100644 index 0000000..2cbbb1d --- /dev/null +++ b/pkg/rpc/pb/service_metric_chart.pb.go @@ -0,0 +1,1127 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_metric_chart.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 CreateMetricChartRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricItemId int64 `protobuf:"varint,1,opt,name=metricItemId,proto3" json:"metricItemId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + WidthDiv int32 `protobuf:"varint,4,opt,name=widthDiv,proto3" json:"widthDiv,omitempty"` + ParamsJSON []byte `protobuf:"bytes,5,opt,name=paramsJSON,proto3" json:"paramsJSON,omitempty"` + MaxItems int32 `protobuf:"varint,6,opt,name=maxItems,proto3" json:"maxItems,omitempty"` +} + +func (x *CreateMetricChartRequest) Reset() { + *x = CreateMetricChartRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateMetricChartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateMetricChartRequest) ProtoMessage() {} + +func (x *CreateMetricChartRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_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 CreateMetricChartRequest.ProtoReflect.Descriptor instead. +func (*CreateMetricChartRequest) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateMetricChartRequest) GetMetricItemId() int64 { + if x != nil { + return x.MetricItemId + } + return 0 +} + +func (x *CreateMetricChartRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateMetricChartRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CreateMetricChartRequest) GetWidthDiv() int32 { + if x != nil { + return x.WidthDiv + } + return 0 +} + +func (x *CreateMetricChartRequest) GetParamsJSON() []byte { + if x != nil { + return x.ParamsJSON + } + return nil +} + +func (x *CreateMetricChartRequest) GetMaxItems() int32 { + if x != nil { + return x.MaxItems + } + return 0 +} + +type CreateMetricChartResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricChartId int64 `protobuf:"varint,1,opt,name=metricChartId,proto3" json:"metricChartId,omitempty"` +} + +func (x *CreateMetricChartResponse) Reset() { + *x = CreateMetricChartResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateMetricChartResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateMetricChartResponse) ProtoMessage() {} + +func (x *CreateMetricChartResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_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 CreateMetricChartResponse.ProtoReflect.Descriptor instead. +func (*CreateMetricChartResponse) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateMetricChartResponse) GetMetricChartId() int64 { + if x != nil { + return x.MetricChartId + } + return 0 +} + +// 修改图表 +type UpdateMetricChartRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricChartId int64 `protobuf:"varint,1,opt,name=metricChartId,proto3" json:"metricChartId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + WidthDiv int32 `protobuf:"varint,4,opt,name=widthDiv,proto3" json:"widthDiv,omitempty"` + ParamsJSON []byte `protobuf:"bytes,5,opt,name=paramsJSON,proto3" json:"paramsJSON,omitempty"` + IsOn bool `protobuf:"varint,6,opt,name=isOn,proto3" json:"isOn,omitempty"` + MaxItems int32 `protobuf:"varint,7,opt,name=maxItems,proto3" json:"maxItems,omitempty"` +} + +func (x *UpdateMetricChartRequest) Reset() { + *x = UpdateMetricChartRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateMetricChartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateMetricChartRequest) ProtoMessage() {} + +func (x *UpdateMetricChartRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_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 UpdateMetricChartRequest.ProtoReflect.Descriptor instead. +func (*UpdateMetricChartRequest) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateMetricChartRequest) GetMetricChartId() int64 { + if x != nil { + return x.MetricChartId + } + return 0 +} + +func (x *UpdateMetricChartRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateMetricChartRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UpdateMetricChartRequest) GetWidthDiv() int32 { + if x != nil { + return x.WidthDiv + } + return 0 +} + +func (x *UpdateMetricChartRequest) GetParamsJSON() []byte { + if x != nil { + return x.ParamsJSON + } + return nil +} + +func (x *UpdateMetricChartRequest) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *UpdateMetricChartRequest) GetMaxItems() int32 { + if x != nil { + return x.MaxItems + } + return 0 +} + +// 查找单个图表 +type FindEnabledMetricChartRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricChartId int64 `protobuf:"varint,1,opt,name=metricChartId,proto3" json:"metricChartId,omitempty"` +} + +func (x *FindEnabledMetricChartRequest) Reset() { + *x = FindEnabledMetricChartRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledMetricChartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledMetricChartRequest) ProtoMessage() {} + +func (x *FindEnabledMetricChartRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_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 FindEnabledMetricChartRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledMetricChartRequest) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{3} +} + +func (x *FindEnabledMetricChartRequest) GetMetricChartId() int64 { + if x != nil { + return x.MetricChartId + } + return 0 +} + +type FindEnabledMetricChartResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricChart *MetricChart `protobuf:"bytes,1,opt,name=metricChart,proto3" json:"metricChart,omitempty"` +} + +func (x *FindEnabledMetricChartResponse) Reset() { + *x = FindEnabledMetricChartResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledMetricChartResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledMetricChartResponse) ProtoMessage() {} + +func (x *FindEnabledMetricChartResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_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 FindEnabledMetricChartResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledMetricChartResponse) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{4} +} + +func (x *FindEnabledMetricChartResponse) GetMetricChart() *MetricChart { + if x != nil { + return x.MetricChart + } + return nil +} + +// 计算图表数量 +type CountEnabledMetricChartsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricItemId int64 `protobuf:"varint,1,opt,name=metricItemId,proto3" json:"metricItemId,omitempty"` +} + +func (x *CountEnabledMetricChartsRequest) Reset() { + *x = CountEnabledMetricChartsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountEnabledMetricChartsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountEnabledMetricChartsRequest) ProtoMessage() {} + +func (x *CountEnabledMetricChartsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_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 CountEnabledMetricChartsRequest.ProtoReflect.Descriptor instead. +func (*CountEnabledMetricChartsRequest) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{5} +} + +func (x *CountEnabledMetricChartsRequest) GetMetricItemId() int64 { + if x != nil { + return x.MetricItemId + } + return 0 +} + +// 列出单页图表 +type ListEnabledMetricChartsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricItemId int64 `protobuf:"varint,1,opt,name=metricItemId,proto3" json:"metricItemId,omitempty"` + Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListEnabledMetricChartsRequest) Reset() { + *x = ListEnabledMetricChartsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledMetricChartsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledMetricChartsRequest) ProtoMessage() {} + +func (x *ListEnabledMetricChartsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_proto_msgTypes[6] + 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 ListEnabledMetricChartsRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledMetricChartsRequest) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{6} +} + +func (x *ListEnabledMetricChartsRequest) GetMetricItemId() int64 { + if x != nil { + return x.MetricItemId + } + return 0 +} + +func (x *ListEnabledMetricChartsRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListEnabledMetricChartsRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListEnabledMetricChartsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricCharts []*MetricChart `protobuf:"bytes,1,rep,name=metricCharts,proto3" json:"metricCharts,omitempty"` +} + +func (x *ListEnabledMetricChartsResponse) Reset() { + *x = ListEnabledMetricChartsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledMetricChartsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledMetricChartsResponse) ProtoMessage() {} + +func (x *ListEnabledMetricChartsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_proto_msgTypes[7] + 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 ListEnabledMetricChartsResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledMetricChartsResponse) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{7} +} + +func (x *ListEnabledMetricChartsResponse) GetMetricCharts() []*MetricChart { + if x != nil { + return x.MetricCharts + } + return nil +} + +// 删除图表 +type DeleteMetricChartRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MetricChartId int64 `protobuf:"varint,1,opt,name=metricChartId,proto3" json:"metricChartId,omitempty"` +} + +func (x *DeleteMetricChartRequest) Reset() { + *x = DeleteMetricChartRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_metric_chart_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteMetricChartRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteMetricChartRequest) ProtoMessage() {} + +func (x *DeleteMetricChartRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_metric_chart_proto_msgTypes[8] + 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 DeleteMetricChartRequest.ProtoReflect.Descriptor instead. +func (*DeleteMetricChartRequest) Descriptor() ([]byte, []int) { + return file_service_metric_chart_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteMetricChartRequest) GetMetricChartId() int64 { + if x != nil { + return x.MetricChartId + } + return 0 +} + +var File_service_metric_chart_proto protoreflect.FileDescriptor + +var file_service_metric_chart_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x5f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, + 0x1a, 0x1f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 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, 0x22, 0xbe, 0x01, 0x0a, + 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, + 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x69, 0x64, 0x74, 0x68, 0x44, 0x69, + 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x77, 0x69, 0x64, 0x74, 0x68, 0x44, 0x69, + 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, + 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x41, 0x0a, + 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, + 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x49, 0x64, + 0x22, 0xd4, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, + 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, + 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x44, 0x69, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x44, 0x69, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, + 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, + 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x45, 0x0a, 0x1d, 0x46, 0x69, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x49, 0x64, 0x22, 0x53, + 0x0a, 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x31, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, + 0x61, 0x72, 0x74, 0x22, 0x45, 0x0a, 0x1f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0x70, 0x0a, 0x1e, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, + 0x68, 0x61, 0x72, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x56, 0x0a, 0x1f, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x33, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, + 0x61, 0x72, 0x74, 0x73, 0x22, 0x40, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, + 0x68, 0x61, 0x72, 0x74, 0x49, 0x64, 0x32, 0x88, 0x04, 0x0a, 0x12, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, + 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, + 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x41, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, + 0x68, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x5f, 0x0a, 0x16, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x21, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x18, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 0x73, 0x12, + 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 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, 0x62, 0x0a, 0x17, 0x6c, 0x69, + 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, + 0x68, 0x61, 0x72, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x43, 0x68, 0x61, 0x72, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, + 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, + 0x61, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x68, 0x61, 0x72, 0x74, 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_metric_chart_proto_rawDescOnce sync.Once + file_service_metric_chart_proto_rawDescData = file_service_metric_chart_proto_rawDesc +) + +func file_service_metric_chart_proto_rawDescGZIP() []byte { + file_service_metric_chart_proto_rawDescOnce.Do(func() { + file_service_metric_chart_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_metric_chart_proto_rawDescData) + }) + return file_service_metric_chart_proto_rawDescData +} + +var file_service_metric_chart_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_service_metric_chart_proto_goTypes = []interface{}{ + (*CreateMetricChartRequest)(nil), // 0: pb.CreateMetricChartRequest + (*CreateMetricChartResponse)(nil), // 1: pb.CreateMetricChartResponse + (*UpdateMetricChartRequest)(nil), // 2: pb.UpdateMetricChartRequest + (*FindEnabledMetricChartRequest)(nil), // 3: pb.FindEnabledMetricChartRequest + (*FindEnabledMetricChartResponse)(nil), // 4: pb.FindEnabledMetricChartResponse + (*CountEnabledMetricChartsRequest)(nil), // 5: pb.CountEnabledMetricChartsRequest + (*ListEnabledMetricChartsRequest)(nil), // 6: pb.ListEnabledMetricChartsRequest + (*ListEnabledMetricChartsResponse)(nil), // 7: pb.ListEnabledMetricChartsResponse + (*DeleteMetricChartRequest)(nil), // 8: pb.DeleteMetricChartRequest + (*MetricChart)(nil), // 9: pb.MetricChart + (*RPCSuccess)(nil), // 10: pb.RPCSuccess + (*RPCCountResponse)(nil), // 11: pb.RPCCountResponse +} +var file_service_metric_chart_proto_depIdxs = []int32{ + 9, // 0: pb.FindEnabledMetricChartResponse.metricChart:type_name -> pb.MetricChart + 9, // 1: pb.ListEnabledMetricChartsResponse.metricCharts:type_name -> pb.MetricChart + 0, // 2: pb.MetricChartService.createMetricChart:input_type -> pb.CreateMetricChartRequest + 2, // 3: pb.MetricChartService.updateMetricChart:input_type -> pb.UpdateMetricChartRequest + 3, // 4: pb.MetricChartService.findEnabledMetricChart:input_type -> pb.FindEnabledMetricChartRequest + 5, // 5: pb.MetricChartService.countEnabledMetricCharts:input_type -> pb.CountEnabledMetricChartsRequest + 6, // 6: pb.MetricChartService.listEnabledMetricCharts:input_type -> pb.ListEnabledMetricChartsRequest + 8, // 7: pb.MetricChartService.deleteMetricChart:input_type -> pb.DeleteMetricChartRequest + 1, // 8: pb.MetricChartService.createMetricChart:output_type -> pb.CreateMetricChartResponse + 10, // 9: pb.MetricChartService.updateMetricChart:output_type -> pb.RPCSuccess + 4, // 10: pb.MetricChartService.findEnabledMetricChart:output_type -> pb.FindEnabledMetricChartResponse + 11, // 11: pb.MetricChartService.countEnabledMetricCharts:output_type -> pb.RPCCountResponse + 7, // 12: pb.MetricChartService.listEnabledMetricCharts:output_type -> pb.ListEnabledMetricChartsResponse + 10, // 13: pb.MetricChartService.deleteMetricChart:output_type -> pb.RPCSuccess + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] 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_metric_chart_proto_init() } +func file_service_metric_chart_proto_init() { + if File_service_metric_chart_proto != nil { + return + } + file_models_model_metric_chart_proto_init() + file_models_rpc_messages_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_metric_chart_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateMetricChartRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateMetricChartResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateMetricChartRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledMetricChartRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledMetricChartResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountEnabledMetricChartsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledMetricChartsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledMetricChartsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_metric_chart_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteMetricChartRequest); 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_metric_chart_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_metric_chart_proto_goTypes, + DependencyIndexes: file_service_metric_chart_proto_depIdxs, + MessageInfos: file_service_metric_chart_proto_msgTypes, + }.Build() + File_service_metric_chart_proto = out.File + file_service_metric_chart_proto_rawDesc = nil + file_service_metric_chart_proto_goTypes = nil + file_service_metric_chart_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 + +// MetricChartServiceClient is the client API for MetricChartService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MetricChartServiceClient interface { + // 创建图表 + CreateMetricChart(ctx context.Context, in *CreateMetricChartRequest, opts ...grpc.CallOption) (*CreateMetricChartResponse, error) + // 修改图表 + UpdateMetricChart(ctx context.Context, in *UpdateMetricChartRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 查找单个图表 + FindEnabledMetricChart(ctx context.Context, in *FindEnabledMetricChartRequest, opts ...grpc.CallOption) (*FindEnabledMetricChartResponse, error) + // 计算图表数量 + CountEnabledMetricCharts(ctx context.Context, in *CountEnabledMetricChartsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) + // 列出单页图表 + ListEnabledMetricCharts(ctx context.Context, in *ListEnabledMetricChartsRequest, opts ...grpc.CallOption) (*ListEnabledMetricChartsResponse, error) + // 删除图表 + DeleteMetricChart(ctx context.Context, in *DeleteMetricChartRequest, opts ...grpc.CallOption) (*RPCSuccess, error) +} + +type metricChartServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMetricChartServiceClient(cc grpc.ClientConnInterface) MetricChartServiceClient { + return &metricChartServiceClient{cc} +} + +func (c *metricChartServiceClient) CreateMetricChart(ctx context.Context, in *CreateMetricChartRequest, opts ...grpc.CallOption) (*CreateMetricChartResponse, error) { + out := new(CreateMetricChartResponse) + err := c.cc.Invoke(ctx, "/pb.MetricChartService/createMetricChart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricChartServiceClient) UpdateMetricChart(ctx context.Context, in *UpdateMetricChartRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.MetricChartService/updateMetricChart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricChartServiceClient) FindEnabledMetricChart(ctx context.Context, in *FindEnabledMetricChartRequest, opts ...grpc.CallOption) (*FindEnabledMetricChartResponse, error) { + out := new(FindEnabledMetricChartResponse) + err := c.cc.Invoke(ctx, "/pb.MetricChartService/findEnabledMetricChart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricChartServiceClient) CountEnabledMetricCharts(ctx context.Context, in *CountEnabledMetricChartsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) { + out := new(RPCCountResponse) + err := c.cc.Invoke(ctx, "/pb.MetricChartService/countEnabledMetricCharts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricChartServiceClient) ListEnabledMetricCharts(ctx context.Context, in *ListEnabledMetricChartsRequest, opts ...grpc.CallOption) (*ListEnabledMetricChartsResponse, error) { + out := new(ListEnabledMetricChartsResponse) + err := c.cc.Invoke(ctx, "/pb.MetricChartService/listEnabledMetricCharts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metricChartServiceClient) DeleteMetricChart(ctx context.Context, in *DeleteMetricChartRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.MetricChartService/deleteMetricChart", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MetricChartServiceServer is the server API for MetricChartService service. +type MetricChartServiceServer interface { + // 创建图表 + CreateMetricChart(context.Context, *CreateMetricChartRequest) (*CreateMetricChartResponse, error) + // 修改图表 + UpdateMetricChart(context.Context, *UpdateMetricChartRequest) (*RPCSuccess, error) + // 查找单个图表 + FindEnabledMetricChart(context.Context, *FindEnabledMetricChartRequest) (*FindEnabledMetricChartResponse, error) + // 计算图表数量 + CountEnabledMetricCharts(context.Context, *CountEnabledMetricChartsRequest) (*RPCCountResponse, error) + // 列出单页图表 + ListEnabledMetricCharts(context.Context, *ListEnabledMetricChartsRequest) (*ListEnabledMetricChartsResponse, error) + // 删除图表 + DeleteMetricChart(context.Context, *DeleteMetricChartRequest) (*RPCSuccess, error) +} + +// UnimplementedMetricChartServiceServer can be embedded to have forward compatible implementations. +type UnimplementedMetricChartServiceServer struct { +} + +func (*UnimplementedMetricChartServiceServer) CreateMetricChart(context.Context, *CreateMetricChartRequest) (*CreateMetricChartResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateMetricChart not implemented") +} +func (*UnimplementedMetricChartServiceServer) UpdateMetricChart(context.Context, *UpdateMetricChartRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMetricChart not implemented") +} +func (*UnimplementedMetricChartServiceServer) FindEnabledMetricChart(context.Context, *FindEnabledMetricChartRequest) (*FindEnabledMetricChartResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledMetricChart not implemented") +} +func (*UnimplementedMetricChartServiceServer) CountEnabledMetricCharts(context.Context, *CountEnabledMetricChartsRequest) (*RPCCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountEnabledMetricCharts not implemented") +} +func (*UnimplementedMetricChartServiceServer) ListEnabledMetricCharts(context.Context, *ListEnabledMetricChartsRequest) (*ListEnabledMetricChartsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledMetricCharts not implemented") +} +func (*UnimplementedMetricChartServiceServer) DeleteMetricChart(context.Context, *DeleteMetricChartRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMetricChart not implemented") +} + +func RegisterMetricChartServiceServer(s *grpc.Server, srv MetricChartServiceServer) { + s.RegisterService(&_MetricChartService_serviceDesc, srv) +} + +func _MetricChartService_CreateMetricChart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateMetricChartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricChartServiceServer).CreateMetricChart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.MetricChartService/CreateMetricChart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricChartServiceServer).CreateMetricChart(ctx, req.(*CreateMetricChartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricChartService_UpdateMetricChart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMetricChartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricChartServiceServer).UpdateMetricChart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.MetricChartService/UpdateMetricChart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricChartServiceServer).UpdateMetricChart(ctx, req.(*UpdateMetricChartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricChartService_FindEnabledMetricChart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledMetricChartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricChartServiceServer).FindEnabledMetricChart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.MetricChartService/FindEnabledMetricChart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricChartServiceServer).FindEnabledMetricChart(ctx, req.(*FindEnabledMetricChartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricChartService_CountEnabledMetricCharts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountEnabledMetricChartsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricChartServiceServer).CountEnabledMetricCharts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.MetricChartService/CountEnabledMetricCharts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricChartServiceServer).CountEnabledMetricCharts(ctx, req.(*CountEnabledMetricChartsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricChartService_ListEnabledMetricCharts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledMetricChartsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricChartServiceServer).ListEnabledMetricCharts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.MetricChartService/ListEnabledMetricCharts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricChartServiceServer).ListEnabledMetricCharts(ctx, req.(*ListEnabledMetricChartsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MetricChartService_DeleteMetricChart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMetricChartRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricChartServiceServer).DeleteMetricChart(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.MetricChartService/DeleteMetricChart", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricChartServiceServer).DeleteMetricChart(ctx, req.(*DeleteMetricChartRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _MetricChartService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.MetricChartService", + HandlerType: (*MetricChartServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createMetricChart", + Handler: _MetricChartService_CreateMetricChart_Handler, + }, + { + MethodName: "updateMetricChart", + Handler: _MetricChartService_UpdateMetricChart_Handler, + }, + { + MethodName: "findEnabledMetricChart", + Handler: _MetricChartService_FindEnabledMetricChart_Handler, + }, + { + MethodName: "countEnabledMetricCharts", + Handler: _MetricChartService_CountEnabledMetricCharts_Handler, + }, + { + MethodName: "listEnabledMetricCharts", + Handler: _MetricChartService_ListEnabledMetricCharts_Handler, + }, + { + MethodName: "deleteMetricChart", + Handler: _MetricChartService_DeleteMetricChart_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_metric_chart.proto", +} diff --git a/pkg/rpc/protos/models/model_metric_chart.proto b/pkg/rpc/protos/models/model_metric_chart.proto new file mode 100644 index 0000000..fc9bb41 --- /dev/null +++ b/pkg/rpc/protos/models/model_metric_chart.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/model_metric_item.proto"; + +// 指标图表 +message MetricChart { + int64 id = 1; + string name = 2; + string type = 3; + int32 widthDiv = 4; + bytes paramsJSON = 5; + bool isOn = 6; + int32 maxItems = 7; + + MetricItem metricItem = 30; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_metric_chart.proto b/pkg/rpc/protos/service_metric_chart.proto new file mode 100644 index 0000000..edaeb65 --- /dev/null +++ b/pkg/rpc/protos/service_metric_chart.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/model_metric_chart.proto"; +import "models/rpc_messages.proto"; + +// 指标图表相关服务 +service MetricChartService { + // 创建图表 + rpc createMetricChart (CreateMetricChartRequest) returns (CreateMetricChartResponse); + + // 修改图表 + rpc updateMetricChart (UpdateMetricChartRequest) returns (RPCSuccess); + + // 查找单个图表 + rpc findEnabledMetricChart (FindEnabledMetricChartRequest) returns (FindEnabledMetricChartResponse); + + // 计算图表数量 + rpc countEnabledMetricCharts (CountEnabledMetricChartsRequest) returns (RPCCountResponse); + + // 列出单页图表 + rpc listEnabledMetricCharts (ListEnabledMetricChartsRequest) returns (ListEnabledMetricChartsResponse); + + // 删除图表 + rpc deleteMetricChart (DeleteMetricChartRequest) returns (RPCSuccess); +} + +// 创建图表 +message CreateMetricChartRequest { + int64 metricItemId = 1; + string name = 2; + string type = 3; + int32 widthDiv = 4; + bytes paramsJSON = 5; + int32 maxItems = 6; +} + +message CreateMetricChartResponse { + int64 metricChartId = 1; +} + +// 修改图表 +message UpdateMetricChartRequest { + int64 metricChartId = 1; + string name = 2; + string type = 3; + int32 widthDiv = 4; + bytes paramsJSON = 5; + bool isOn = 6; + int32 maxItems = 7; +} + +// 查找单个图表 +message FindEnabledMetricChartRequest { + int64 metricChartId = 1; +} + +message FindEnabledMetricChartResponse { + MetricChart metricChart = 1; +} + +// 计算图表数量 +message CountEnabledMetricChartsRequest { + int64 metricItemId = 1; +} + +// 列出单页图表 +message ListEnabledMetricChartsRequest { + int64 metricItemId = 1; + int64 offset = 2; + int64 size = 3; +} + +message ListEnabledMetricChartsResponse { + repeated MetricChart metricCharts = 1; +} + +// 删除图表 +message DeleteMetricChartRequest { + int64 metricChartId = 1; +} \ No newline at end of file diff --git a/pkg/serverconfigs/metric_chart.go b/pkg/serverconfigs/metric_chart.go new file mode 100644 index 0000000..12aa82f --- /dev/null +++ b/pkg/serverconfigs/metric_chart.go @@ -0,0 +1,59 @@ +// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. + +package serverconfigs + +import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared" + +type MetricChartType = string + +const ( + MetricChartTypePie MetricChartType = "pie" + MetricChartTypeBar MetricChartType = "bar" + MetricChartTypeTimeBar MetricChartType = "timeBar" + MetricChartTypeTimeLine MetricChartType = "timeLine" + MetricChartTypeTable MetricChartType = "table" +) + +func FindAllMetricChartTypes() []*shared.Definition { + return []*shared.Definition{ + { + Name: "柱图", + Code: MetricChartTypeBar, + Description: "通过柱图展示各个对象的排行。", + Icon: "chart bar", + }, + { + Name: "饼图", + Code: MetricChartTypePie, + Description: "通过饼图展示各个对象的占比。", + Icon: "chart pie", + }, + { + Name: "时间柱图", + Code: MetricChartTypeTimeBar, + Description: "通过柱图展示各个对象在不同时间段的变化。", + Icon: "chart bar", + }, + { + Name: "时间线图", + Code: MetricChartTypeTimeLine, + Description: "通过线图展示各个对象在不同时间段的变化。", + Icon: "chart line area", + }, + { + Name: "表格", + Code: MetricChartTypeTable, + Description: "以表格的形式展示数据。", + Icon: "table", + }, + } +} + +func FindAllMetricChartTypeName(chartType MetricChartType) string { + for _, def := range FindAllMetricChartTypes() { + if def.Code == chartType { + return def.Name + } + } + return "" +} diff --git a/pkg/serverconfigs/shared/definition.go b/pkg/serverconfigs/shared/definition.go new file mode 100644 index 0000000..542d211 --- /dev/null +++ b/pkg/serverconfigs/shared/definition.go @@ -0,0 +1,11 @@ +// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. + +package shared + +// Definition 数据定义 +type Definition struct { + Name string `json:"name"` + Code string `json:"code"` + Description string `json:"description"` + Icon string `json:"icon"` +}