diff --git a/pkg/rpc/pb/service_user.pb.go b/pkg/rpc/pb/service_user.pb.go index 692c055..32faf8d 100644 --- a/pkg/rpc/pb/service_user.pb.go +++ b/pkg/rpc/pb/service_user.pb.go @@ -920,6 +920,204 @@ func (x *UpdateUserLoginRequest) GetPassword() string { return "" } +// 取得用户Dashboard数据 +type ComposeUserDashboardRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` +} + +func (x *ComposeUserDashboardRequest) Reset() { + *x = ComposeUserDashboardRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ComposeUserDashboardRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComposeUserDashboardRequest) ProtoMessage() {} + +func (x *ComposeUserDashboardRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_proto_msgTypes[15] + 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 ComposeUserDashboardRequest.ProtoReflect.Descriptor instead. +func (*ComposeUserDashboardRequest) Descriptor() ([]byte, []int) { + return file_service_user_proto_rawDescGZIP(), []int{15} +} + +func (x *ComposeUserDashboardRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +type ComposeUserDashboardResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CountServers int64 `protobuf:"varint,1,opt,name=countServers,proto3" json:"countServers,omitempty"` + MonthlyTrafficBytes int64 `protobuf:"varint,2,opt,name=monthlyTrafficBytes,proto3" json:"monthlyTrafficBytes,omitempty"` + MonthlyPeekTrafficBytes int64 `protobuf:"varint,3,opt,name=monthlyPeekTrafficBytes,proto3" json:"monthlyPeekTrafficBytes,omitempty"` + DailyTrafficBytes int64 `protobuf:"varint,4,opt,name=dailyTrafficBytes,proto3" json:"dailyTrafficBytes,omitempty"` + DailyPeekTrafficBytes int64 `protobuf:"varint,5,opt,name=dailyPeekTrafficBytes,proto3" json:"dailyPeekTrafficBytes,omitempty"` + DailyTrafficStats []*ComposeUserDashboardResponse_DailyStat `protobuf:"bytes,6,rep,name=dailyTrafficStats,proto3" json:"dailyTrafficStats,omitempty"` + DailyPeekTrafficStats []*ComposeUserDashboardResponse_DailyStat `protobuf:"bytes,7,rep,name=dailyPeekTrafficStats,proto3" json:"dailyPeekTrafficStats,omitempty"` +} + +func (x *ComposeUserDashboardResponse) Reset() { + *x = ComposeUserDashboardResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ComposeUserDashboardResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComposeUserDashboardResponse) ProtoMessage() {} + +func (x *ComposeUserDashboardResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_proto_msgTypes[16] + 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 ComposeUserDashboardResponse.ProtoReflect.Descriptor instead. +func (*ComposeUserDashboardResponse) Descriptor() ([]byte, []int) { + return file_service_user_proto_rawDescGZIP(), []int{16} +} + +func (x *ComposeUserDashboardResponse) GetCountServers() int64 { + if x != nil { + return x.CountServers + } + return 0 +} + +func (x *ComposeUserDashboardResponse) GetMonthlyTrafficBytes() int64 { + if x != nil { + return x.MonthlyTrafficBytes + } + return 0 +} + +func (x *ComposeUserDashboardResponse) GetMonthlyPeekTrafficBytes() int64 { + if x != nil { + return x.MonthlyPeekTrafficBytes + } + return 0 +} + +func (x *ComposeUserDashboardResponse) GetDailyTrafficBytes() int64 { + if x != nil { + return x.DailyTrafficBytes + } + return 0 +} + +func (x *ComposeUserDashboardResponse) GetDailyPeekTrafficBytes() int64 { + if x != nil { + return x.DailyPeekTrafficBytes + } + return 0 +} + +func (x *ComposeUserDashboardResponse) GetDailyTrafficStats() []*ComposeUserDashboardResponse_DailyStat { + if x != nil { + return x.DailyTrafficStats + } + return nil +} + +func (x *ComposeUserDashboardResponse) GetDailyPeekTrafficStats() []*ComposeUserDashboardResponse_DailyStat { + if x != nil { + return x.DailyPeekTrafficStats + } + return nil +} + +type ComposeUserDashboardResponse_DailyStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"` + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *ComposeUserDashboardResponse_DailyStat) Reset() { + *x = ComposeUserDashboardResponse_DailyStat{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ComposeUserDashboardResponse_DailyStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ComposeUserDashboardResponse_DailyStat) ProtoMessage() {} + +func (x *ComposeUserDashboardResponse_DailyStat) ProtoReflect() protoreflect.Message { + mi := &file_service_user_proto_msgTypes[17] + 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 ComposeUserDashboardResponse_DailyStat.ProtoReflect.Descriptor instead. +func (*ComposeUserDashboardResponse_DailyStat) Descriptor() ([]byte, []int) { + return file_service_user_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *ComposeUserDashboardResponse_DailyStat) GetDay() string { + if x != nil { + return x.Day + } + return "" +} + +func (x *ComposeUserDashboardResponse_DailyStat) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + var File_service_user_proto protoreflect.FileDescriptor var file_service_user_proto_rawDesc = []byte{ @@ -1008,51 +1206,92 @@ var file_service_user_proto_rawDesc = []byte{ 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x32, 0xa6, 0x05, 0x0a, 0x0b, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, - 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x64, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x35, 0x0a, 0x1b, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x22, 0x83, 0x04, 0x0a, 0x1c, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, + 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x13, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, + 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x17, 0x6d, 0x6f, 0x6e, 0x74, 0x68, + 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c, + 0x79, 0x50, 0x65, 0x65, 0x6b, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, + 0x63, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x64, 0x61, + 0x69, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, + 0x34, 0x0a, 0x15, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x54, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x63, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, + 0x64, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x11, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x54, 0x72, + 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x52, 0x11, 0x64, 0x61, + 0x69, 0x6c, 0x79, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x60, 0x0a, 0x15, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x50, 0x65, 0x65, 0x6b, 0x54, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, + 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x52, 0x15, 0x64, 0x61, 0x69, 0x6c, + 0x79, 0x50, 0x65, 0x65, 0x6b, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x1a, 0x33, 0x0a, 0x09, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x12, 0x10, + 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x61, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x81, 0x06, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, + 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x4d, 0x0a, + 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 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, 0x4d, 0x0a, 0x10, + 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, + 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, + 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, + 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x6c, 0x6f, 0x67, + 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x12, 0x4d, 0x0a, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, - 0x72, 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, - 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, - 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, - 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x09, - 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 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, + 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 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, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, + 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, + 0x72, 0x64, 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 ( @@ -1067,55 +1306,62 @@ func file_service_user_proto_rawDescGZIP() []byte { return file_service_user_proto_rawDescData } -var file_service_user_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_service_user_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_service_user_proto_goTypes = []interface{}{ - (*CreateUserRequest)(nil), // 0: pb.CreateUserRequest - (*CreateUserResponse)(nil), // 1: pb.CreateUserResponse - (*UpdateUserRequest)(nil), // 2: pb.UpdateUserRequest - (*DeleteUserRequest)(nil), // 3: pb.DeleteUserRequest - (*CountAllEnabledUsersRequest)(nil), // 4: pb.CountAllEnabledUsersRequest - (*ListEnabledUsersRequest)(nil), // 5: pb.ListEnabledUsersRequest - (*ListEnabledUsersResponse)(nil), // 6: pb.ListEnabledUsersResponse - (*FindEnabledUserRequest)(nil), // 7: pb.FindEnabledUserRequest - (*FindEnabledUserResponse)(nil), // 8: pb.FindEnabledUserResponse - (*CheckUserUsernameRequest)(nil), // 9: pb.CheckUserUsernameRequest - (*CheckUserUsernameResponse)(nil), // 10: pb.CheckUserUsernameResponse - (*LoginUserRequest)(nil), // 11: pb.LoginUserRequest - (*LoginUserResponse)(nil), // 12: pb.LoginUserResponse - (*UpdateUserInfoRequest)(nil), // 13: pb.UpdateUserInfoRequest - (*UpdateUserLoginRequest)(nil), // 14: pb.UpdateUserLoginRequest - (*User)(nil), // 15: pb.User - (*RPCSuccess)(nil), // 16: pb.RPCSuccess - (*RPCCountResponse)(nil), // 17: pb.RPCCountResponse + (*CreateUserRequest)(nil), // 0: pb.CreateUserRequest + (*CreateUserResponse)(nil), // 1: pb.CreateUserResponse + (*UpdateUserRequest)(nil), // 2: pb.UpdateUserRequest + (*DeleteUserRequest)(nil), // 3: pb.DeleteUserRequest + (*CountAllEnabledUsersRequest)(nil), // 4: pb.CountAllEnabledUsersRequest + (*ListEnabledUsersRequest)(nil), // 5: pb.ListEnabledUsersRequest + (*ListEnabledUsersResponse)(nil), // 6: pb.ListEnabledUsersResponse + (*FindEnabledUserRequest)(nil), // 7: pb.FindEnabledUserRequest + (*FindEnabledUserResponse)(nil), // 8: pb.FindEnabledUserResponse + (*CheckUserUsernameRequest)(nil), // 9: pb.CheckUserUsernameRequest + (*CheckUserUsernameResponse)(nil), // 10: pb.CheckUserUsernameResponse + (*LoginUserRequest)(nil), // 11: pb.LoginUserRequest + (*LoginUserResponse)(nil), // 12: pb.LoginUserResponse + (*UpdateUserInfoRequest)(nil), // 13: pb.UpdateUserInfoRequest + (*UpdateUserLoginRequest)(nil), // 14: pb.UpdateUserLoginRequest + (*ComposeUserDashboardRequest)(nil), // 15: pb.ComposeUserDashboardRequest + (*ComposeUserDashboardResponse)(nil), // 16: pb.ComposeUserDashboardResponse + (*ComposeUserDashboardResponse_DailyStat)(nil), // 17: pb.ComposeUserDashboardResponse.DailyStat + (*User)(nil), // 18: pb.User + (*RPCSuccess)(nil), // 19: pb.RPCSuccess + (*RPCCountResponse)(nil), // 20: pb.RPCCountResponse } var file_service_user_proto_depIdxs = []int32{ - 15, // 0: pb.ListEnabledUsersResponse.users:type_name -> pb.User - 15, // 1: pb.FindEnabledUserResponse.user:type_name -> pb.User - 0, // 2: pb.UserService.createUser:input_type -> pb.CreateUserRequest - 2, // 3: pb.UserService.updateUser:input_type -> pb.UpdateUserRequest - 3, // 4: pb.UserService.deleteUser:input_type -> pb.DeleteUserRequest - 4, // 5: pb.UserService.countAllEnabledUsers:input_type -> pb.CountAllEnabledUsersRequest - 5, // 6: pb.UserService.listEnabledUsers:input_type -> pb.ListEnabledUsersRequest - 7, // 7: pb.UserService.findEnabledUser:input_type -> pb.FindEnabledUserRequest - 9, // 8: pb.UserService.checkUserUsername:input_type -> pb.CheckUserUsernameRequest - 11, // 9: pb.UserService.loginUser:input_type -> pb.LoginUserRequest - 13, // 10: pb.UserService.updateUserInfo:input_type -> pb.UpdateUserInfoRequest - 14, // 11: pb.UserService.updateUserLogin:input_type -> pb.UpdateUserLoginRequest - 1, // 12: pb.UserService.createUser:output_type -> pb.CreateUserResponse - 16, // 13: pb.UserService.updateUser:output_type -> pb.RPCSuccess - 16, // 14: pb.UserService.deleteUser:output_type -> pb.RPCSuccess - 17, // 15: pb.UserService.countAllEnabledUsers:output_type -> pb.RPCCountResponse - 6, // 16: pb.UserService.listEnabledUsers:output_type -> pb.ListEnabledUsersResponse - 8, // 17: pb.UserService.findEnabledUser:output_type -> pb.FindEnabledUserResponse - 10, // 18: pb.UserService.checkUserUsername:output_type -> pb.CheckUserUsernameResponse - 12, // 19: pb.UserService.loginUser:output_type -> pb.LoginUserResponse - 16, // 20: pb.UserService.updateUserInfo:output_type -> pb.RPCSuccess - 16, // 21: pb.UserService.updateUserLogin:output_type -> pb.RPCSuccess - 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 + 18, // 0: pb.ListEnabledUsersResponse.users:type_name -> pb.User + 18, // 1: pb.FindEnabledUserResponse.user:type_name -> pb.User + 17, // 2: pb.ComposeUserDashboardResponse.dailyTrafficStats:type_name -> pb.ComposeUserDashboardResponse.DailyStat + 17, // 3: pb.ComposeUserDashboardResponse.dailyPeekTrafficStats:type_name -> pb.ComposeUserDashboardResponse.DailyStat + 0, // 4: pb.UserService.createUser:input_type -> pb.CreateUserRequest + 2, // 5: pb.UserService.updateUser:input_type -> pb.UpdateUserRequest + 3, // 6: pb.UserService.deleteUser:input_type -> pb.DeleteUserRequest + 4, // 7: pb.UserService.countAllEnabledUsers:input_type -> pb.CountAllEnabledUsersRequest + 5, // 8: pb.UserService.listEnabledUsers:input_type -> pb.ListEnabledUsersRequest + 7, // 9: pb.UserService.findEnabledUser:input_type -> pb.FindEnabledUserRequest + 9, // 10: pb.UserService.checkUserUsername:input_type -> pb.CheckUserUsernameRequest + 11, // 11: pb.UserService.loginUser:input_type -> pb.LoginUserRequest + 13, // 12: pb.UserService.updateUserInfo:input_type -> pb.UpdateUserInfoRequest + 14, // 13: pb.UserService.updateUserLogin:input_type -> pb.UpdateUserLoginRequest + 15, // 14: pb.UserService.composeUserDashboard:input_type -> pb.ComposeUserDashboardRequest + 1, // 15: pb.UserService.createUser:output_type -> pb.CreateUserResponse + 19, // 16: pb.UserService.updateUser:output_type -> pb.RPCSuccess + 19, // 17: pb.UserService.deleteUser:output_type -> pb.RPCSuccess + 20, // 18: pb.UserService.countAllEnabledUsers:output_type -> pb.RPCCountResponse + 6, // 19: pb.UserService.listEnabledUsers:output_type -> pb.ListEnabledUsersResponse + 8, // 20: pb.UserService.findEnabledUser:output_type -> pb.FindEnabledUserResponse + 10, // 21: pb.UserService.checkUserUsername:output_type -> pb.CheckUserUsernameResponse + 12, // 22: pb.UserService.loginUser:output_type -> pb.LoginUserResponse + 19, // 23: pb.UserService.updateUserInfo:output_type -> pb.RPCSuccess + 19, // 24: pb.UserService.updateUserLogin:output_type -> pb.RPCSuccess + 16, // 25: pb.UserService.composeUserDashboard:output_type -> pb.ComposeUserDashboardResponse + 15, // [15:26] is the sub-list for method output_type + 4, // [4:15] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_service_user_proto_init() } @@ -1306,6 +1552,42 @@ func file_service_user_proto_init() { return nil } } + file_service_user_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComposeUserDashboardRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComposeUserDashboardResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ComposeUserDashboardResponse_DailyStat); 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{ @@ -1313,7 +1595,7 @@ func file_service_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_user_proto_rawDesc, NumEnums: 0, - NumMessages: 15, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, @@ -1359,6 +1641,8 @@ type UserServiceClient interface { UpdateUserInfo(ctx context.Context, in *UpdateUserInfoRequest, opts ...grpc.CallOption) (*RPCSuccess, error) // 修改用户登录信息 UpdateUserLogin(ctx context.Context, in *UpdateUserLoginRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 取得用户Dashboard数据 + ComposeUserDashboard(ctx context.Context, in *ComposeUserDashboardRequest, opts ...grpc.CallOption) (*ComposeUserDashboardResponse, error) } type userServiceClient struct { @@ -1459,6 +1743,15 @@ func (c *userServiceClient) UpdateUserLogin(ctx context.Context, in *UpdateUserL return out, nil } +func (c *userServiceClient) ComposeUserDashboard(ctx context.Context, in *ComposeUserDashboardRequest, opts ...grpc.CallOption) (*ComposeUserDashboardResponse, error) { + out := new(ComposeUserDashboardResponse) + err := c.cc.Invoke(ctx, "/pb.UserService/composeUserDashboard", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // UserServiceServer is the server API for UserService service. type UserServiceServer interface { // 创建用户 @@ -1481,6 +1774,8 @@ type UserServiceServer interface { UpdateUserInfo(context.Context, *UpdateUserInfoRequest) (*RPCSuccess, error) // 修改用户登录信息 UpdateUserLogin(context.Context, *UpdateUserLoginRequest) (*RPCSuccess, error) + // 取得用户Dashboard数据 + ComposeUserDashboard(context.Context, *ComposeUserDashboardRequest) (*ComposeUserDashboardResponse, error) } // UnimplementedUserServiceServer can be embedded to have forward compatible implementations. @@ -1517,6 +1812,9 @@ func (*UnimplementedUserServiceServer) UpdateUserInfo(context.Context, *UpdateUs func (*UnimplementedUserServiceServer) UpdateUserLogin(context.Context, *UpdateUserLoginRequest) (*RPCSuccess, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUserLogin not implemented") } +func (*UnimplementedUserServiceServer) ComposeUserDashboard(context.Context, *ComposeUserDashboardRequest) (*ComposeUserDashboardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ComposeUserDashboard not implemented") +} func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer) { s.RegisterService(&_UserService_serviceDesc, srv) @@ -1702,6 +2000,24 @@ func _UserService_UpdateUserLogin_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _UserService_ComposeUserDashboard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ComposeUserDashboardRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).ComposeUserDashboard(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserService/ComposeUserDashboard", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).ComposeUserDashboard(ctx, req.(*ComposeUserDashboardRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _UserService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.UserService", HandlerType: (*UserServiceServer)(nil), @@ -1746,6 +2062,10 @@ var _UserService_serviceDesc = grpc.ServiceDesc{ MethodName: "updateUserLogin", Handler: _UserService_UpdateUserLogin_Handler, }, + { + MethodName: "composeUserDashboard", + Handler: _UserService_ComposeUserDashboard_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_user.proto", diff --git a/pkg/rpc/protos/service_user.proto b/pkg/rpc/protos/service_user.proto index 402505d..05942f6 100644 --- a/pkg/rpc/protos/service_user.proto +++ b/pkg/rpc/protos/service_user.proto @@ -37,6 +37,9 @@ service UserService { // 修改用户登录信息 rpc updateUserLogin (UpdateUserLoginRequest) returns (RPCSuccess); + + // 取得用户Dashboard数据 + rpc composeUserDashboard (ComposeUserDashboardRequest) returns (ComposeUserDashboardResponse); } // 创建用户 @@ -129,4 +132,24 @@ message UpdateUserLoginRequest { int64 userId = 1; string username = 2; string password = 3; -} \ No newline at end of file +} + +// 取得用户Dashboard数据 +message ComposeUserDashboardRequest { + int64 userId = 1; +} + +message ComposeUserDashboardResponse { + int64 countServers = 1; + int64 monthlyTrafficBytes = 2; + int64 monthlyPeekTrafficBytes = 3; + int64 dailyTrafficBytes = 4; + int64 dailyPeekTrafficBytes = 5; + repeated DailyStat dailyTrafficStats = 6; + repeated DailyStat dailyPeekTrafficStats = 7; + + message DailyStat { + string day = 1; + int64 count = 2; + } +}