songxiaohang 1 жил өмнө
parent
commit
dd37d4630b

+ 1 - 1
app/cmd/dtgateway/desc/dtgateway/dtgateway.api

@@ -157,7 +157,7 @@ type (
         ProjectId   int64     `json:"project_id"`
         ItemName    string    `json:"item_name"`
         Val         float64   `json:"val"`
-        CTime       string    `json:"h_time"`
+        HTime       string    `json:"h_time"`
     }
 
     MultiAddItemHistoryDataReq{

+ 8 - 8
app/cmd/dtgateway/etc/dtgateway.yaml

@@ -18,13 +18,13 @@ Log:
   Level: error
 
 #rpc service
-#OrganizationRpcConf:
-#  Endpoints:
-#    - 127.0.0.1:1117
-#  NonBlock: true
-#  Timeout: 0
-
 OrganizationRpcConf:
-  Timeout: 50000
-  Target: k8s://gt-datacenter/organization-rpc-svc:1117 #goctl kube 默认生成的k8s yaml的serviceName: {rpc中定义的name}-svc
+  Endpoints:
+    - 127.0.0.1:1117
+  NonBlock: true
+  Timeout: 0
+
+#OrganizationRpcConf:
+#  Timeout: 50000
+#  Target: k8s://gt-datacenter/organization-rpc-svc:1117 #goctl kube 默认生成的k8s yaml的serviceName: {rpc中定义的name}-svc
 

+ 2 - 0
app/cmd/dtgateway/internal/logic/dtgateway/itemHistoryDataInfoLogic.go

@@ -6,6 +6,7 @@ import (
 	"GtDataStore/app/cmd/organization/pb"
 	"GtDataStore/common/xerr"
 	"context"
+	"fmt"
 
 	"github.com/zeromicro/go-zero/core/logx"
 )
@@ -31,6 +32,7 @@ func (l *ItemHistoryDataInfoLogic) ItemHistoryDataInfo(req *types.ItemHistoryDat
 		Stime:     req.STime,
 		Etime:     req.ETime,
 	})
+	fmt.Println("rpc:", dataList)
 	if err != nil {
 		return nil, err
 	}

+ 0 - 3
app/cmd/dtgateway/internal/logic/dtgateway/itemHistoryDataMaxMinLogic.go

@@ -6,8 +6,6 @@ import (
 	"GtDataStore/app/cmd/organization/pb"
 	"GtDataStore/common/xerr"
 	"context"
-	"fmt"
-
 	"github.com/zeromicro/go-zero/core/logx"
 )
 
@@ -35,7 +33,6 @@ func (l *ItemHistoryDataMaxMinLogic) ItemHistoryDataMaxMin(req *types.ItemHistor
 	if err != nil {
 		return nil, err
 	}
-	fmt.Println("rpc:", rpcData)
 	return &types.CommonResponse{
 		Code: xerr.OK,
 		Msg:  xerr.MapErrMsg(xerr.OK),

+ 1 - 1
app/cmd/dtgateway/internal/types/types.go

@@ -159,7 +159,7 @@ type ItemHistoryData struct {
 	ProjectId int64   `json:"project_id"`
 	ItemName  string  `json:"item_name"`
 	Val       float64 `json:"val"`
-	CTime     string  `json:"h_time"`
+	HTime     string  `json:"h_time"`
 }
 
 type MultiAddItemHistoryDataReq struct {

+ 2 - 2
app/cmd/organization/etc/organization.yaml

@@ -13,8 +13,8 @@ Log:
 GtServerIp: 172.16.69.188:8900
 
 DtDataStoreDB:
-#  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(192.168.60.201:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
-  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(172.16.0.195:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
+  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(192.168.60.201:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
+#  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(172.16.0.195:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
 
 Redis:
   Host: 172.16.69.193:36379

+ 6 - 8
app/cmd/organization/internal/logic/itemHistoryDataByTimeLogic.go

@@ -5,7 +5,6 @@ import (
 	"GtDataStore/app/cmd/organization/pb"
 	"GtDataStore/common/xerr"
 	"context"
-	"github.com/jinzhu/copier"
 	"github.com/pkg/errors"
 
 	"github.com/zeromicro/go-zero/core/logx"
@@ -25,20 +24,19 @@ func NewItemHistoryDataByTimeLogic(ctx context.Context, svcCtx *svc.ServiceConte
 	}
 }
 
-func (l *ItemHistoryDataByTimeLogic) ItemHistoryDataByTime(in *pb.ItemHistoryDataByTimeReq) (*pb.MultiAddItemHistoryDataReq, error) {
+func (l *ItemHistoryDataByTimeLogic) ItemHistoryDataByTime(in *pb.ItemHistoryDataByTimeReq) (*pb.ItemHistoryDataListResp, error) {
 	modeList, err := l.svcCtx.ItemHistoryData.QueryHistoryDataByTime(l.ctx, in)
 	if err != nil {
 		return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "model QueryHistoryDataByTime get data err:%v", err)
 	}
-
-	dataList := make([]*pb.ItemHistoryData, 0)
+	dataList := make([]*pb.ItemHistoryDataList, 0)
 	for _, line := range modeList {
-		tmp := &pb.ItemHistoryData{}
-		_ = copier.Copy(tmp, line)
-		tmp.CTime = line.CTime.Format("2006-01-02 15:04:05")
+		tmp := &pb.ItemHistoryDataList{}
+		tmp.ItemName = line.ItemName
+		tmp.Val = line.Val
 		tmp.HTime = line.HTime.Format("2006-01-02 15:04:05")
 		dataList = append(dataList, tmp)
 	}
 
-	return &pb.MultiAddItemHistoryDataReq{List: dataList}, nil
+	return &pb.ItemHistoryDataListResp{List: dataList}, nil
 }

+ 2 - 2
app/cmd/organization/internal/logic/itemHistoryDataListLogic.go

@@ -22,11 +22,11 @@ func NewItemHistoryDataListLogic(ctx context.Context, svcCtx *svc.ServiceContext
 	}
 }
 
-func (l *ItemHistoryDataListLogic) ItemHistoryDataList(in *pb.ItemHistoryDataListReq) (*pb.MultiAddItemHistoryDataReq, error) {
+func (l *ItemHistoryDataListLogic) ItemHistoryDataList(in *pb.ItemHistoryDataListReq) (*pb.ItemHistoryDataListResp, error) {
 	//_, err := l.svcCtx.ItemHistoryData.QueryHistoryData(l.ctx, in)
 	//if err != nil {
 	//	return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "item history data table multi Insert err:%v", err)
 	//}
 
-	return &pb.MultiAddItemHistoryDataReq{}, nil
+	return &pb.ItemHistoryDataListResp{}, nil
 }

+ 2 - 2
app/cmd/organization/internal/logic/itemHistoryDataMaxMinByTimeLogic.go

@@ -31,7 +31,7 @@ func (l *ItemHistoryDataMaxMinByTimeLogic) ItemHistoryDataMaxMinByTime(in *pb.It
 		return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "model QueryHistoryDataMaxMinByTime get data err:%v", err)
 	}
 	return &pb.ItemHistoryDataMaxMinResp{
-		MaxVal: modelData.MaxVal,
-		MinVal: modelData.MinVal,
+		MaxVal: modelData.MaxVal.Float64,
+		MinVal: modelData.MinVal.Float64,
 	}, nil
 }

+ 5 - 5
app/cmd/organization/internal/logic/multiAddItemHistoryDataLogic.go

@@ -6,6 +6,7 @@ import (
 	"GtDataStore/app/model"
 	"GtDataStore/common/xerr"
 	"context"
+	"fmt"
 	"github.com/pkg/errors"
 	"time"
 
@@ -28,16 +29,15 @@ func NewMultiAddItemHistoryDataLogic(ctx context.Context, svcCtx *svc.ServiceCon
 
 func (l *MultiAddItemHistoryDataLogic) MultiAddItemHistoryData(in *pb.MultiAddItemHistoryDataReq) (*pb.MultiAddItemHistoryDataResp, error) {
 	ts := make([]model.DcItemHistoryData, len(in.List))
-
+	layout := "2006-01-02 15:04:05"
 	for i, data := range in.List {
-		layout := "2006-01-02 15:04:05"
-
-		t, _ := time.Parse(layout, data.CTime)
+		t, _ := time.Parse(layout, data.HTime)
+		fmt.Println("t:", t)
+		fmt.Println("data.HTime:", data.HTime)
 		ts[i] = model.DcItemHistoryData{
 			ProjectId: data.ProjectId,
 			ItemName:  data.ItemName,
 			Val:       data.Val,
-			CTime:     time.Now(),
 			HTime:     t,
 		}
 	}

+ 2 - 2
app/cmd/organization/internal/server/organizationServer.go

@@ -52,12 +52,12 @@ func (s *OrganizationServer) MultiAddItemHistoryData(ctx context.Context, in *pb
 	return l.MultiAddItemHistoryData(in)
 }
 
-func (s *OrganizationServer) ItemHistoryDataList(ctx context.Context, in *pb.ItemHistoryDataListReq) (*pb.MultiAddItemHistoryDataReq, error) {
+func (s *OrganizationServer) ItemHistoryDataList(ctx context.Context, in *pb.ItemHistoryDataListReq) (*pb.ItemHistoryDataListResp, error) {
 	l := logic.NewItemHistoryDataListLogic(ctx, s.svcCtx)
 	return l.ItemHistoryDataList(in)
 }
 
-func (s *OrganizationServer) ItemHistoryDataByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) (*pb.MultiAddItemHistoryDataReq, error) {
+func (s *OrganizationServer) ItemHistoryDataByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) (*pb.ItemHistoryDataListResp, error) {
 	l := logic.NewItemHistoryDataByTimeLogic(ctx, s.svcCtx)
 	return l.ItemHistoryDataByTime(in)
 }

+ 20 - 10
app/cmd/organization/organization.proto

@@ -132,13 +132,11 @@ message WorkingValve {
 }
 
 message ItemHistoryData {
-  int64     id = 1;
-  int64     project_id = 2;
-  string    item_name = 3;
+  int64     project_id = 1;
+  string    item_name = 2;
   // @gotags: valid:"val"
-  double    val = 4;
-  string    c_time = 5;
-  string    h_time = 6;
+  double    val = 3;
+  string    h_time = 4;
 }
 
 message MultiAddItemHistoryDataReq {
@@ -166,12 +164,24 @@ message ItemHistoryDataByTimeReq {
 }
 
 message ItemHistoryDataMaxMinResp {
-  // @gotags: valid:"max_val"
+  // @gotags: json:"max_val"
   double    max_val = 1;
-  // @gotags: valid:"min_val"
+  // @gotags: json:"min_val"
   double    min_val = 2;
 }
 
+message ItemHistoryDataList {
+  string    item_name = 1;
+  // @gotags: json:"val"
+  double    val = 2;
+  string    h_time = 3;
+}
+
+message ItemHistoryDataListResp {
+  // @gotags: valid:"list"
+  repeated ItemHistoryDataList list = 1;
+}
+
 service Organization {
   rpc GetWorkingUfByCode(DcWorkingReq) returns(WorkingUf);
   rpc GetWorkingRoByCode(DcWorkingReq) returns(WorkingRo);
@@ -179,7 +189,7 @@ service Organization {
   rpc GetWorkingPumpByCode(DcWorkingReq) returns(WorkingPump);
   rpc GetWorkingValueByCode(DcWorkingReq) returns(WorkingValve);
   rpc MultiAddItemHistoryData(MultiAddItemHistoryDataReq) returns(MultiAddItemHistoryDataResp);
-  rpc ItemHistoryDataList(ItemHistoryDataListReq) returns(MultiAddItemHistoryDataReq);
-  rpc ItemHistoryDataByTime(ItemHistoryDataByTimeReq) returns(MultiAddItemHistoryDataReq);
+  rpc ItemHistoryDataList(ItemHistoryDataListReq) returns(ItemHistoryDataListResp);
+  rpc ItemHistoryDataByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataListResp);
   rpc ItemHistoryDataMaxMinByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataMaxMinResp);
 }

+ 6 - 4
app/cmd/organization/organization/organization.go

@@ -16,7 +16,9 @@ type (
 	DcWorkingReq                = pb.DcWorkingReq
 	ItemHistoryData             = pb.ItemHistoryData
 	ItemHistoryDataByTimeReq    = pb.ItemHistoryDataByTimeReq
+	ItemHistoryDataList         = pb.ItemHistoryDataList
 	ItemHistoryDataListReq      = pb.ItemHistoryDataListReq
+	ItemHistoryDataListResp     = pb.ItemHistoryDataListResp
 	ItemHistoryDataMaxMinResp   = pb.ItemHistoryDataMaxMinResp
 	MultiAddItemHistoryDataReq  = pb.MultiAddItemHistoryDataReq
 	MultiAddItemHistoryDataResp = pb.MultiAddItemHistoryDataResp
@@ -33,8 +35,8 @@ type (
 		GetWorkingPumpByCode(ctx context.Context, in *DcWorkingReq, opts ...grpc.CallOption) (*WorkingPump, error)
 		GetWorkingValueByCode(ctx context.Context, in *DcWorkingReq, opts ...grpc.CallOption) (*WorkingValve, error)
 		MultiAddItemHistoryData(ctx context.Context, in *MultiAddItemHistoryDataReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataResp, error)
-		ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error)
-		ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error)
+		ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error)
+		ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error)
 		ItemHistoryDataMaxMinByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataMaxMinResp, error)
 	}
 
@@ -79,12 +81,12 @@ func (m *defaultOrganization) MultiAddItemHistoryData(ctx context.Context, in *M
 	return client.MultiAddItemHistoryData(ctx, in, opts...)
 }
 
-func (m *defaultOrganization) ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error) {
+func (m *defaultOrganization) ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error) {
 	client := pb.NewOrganizationClient(m.cli.Conn())
 	return client.ItemHistoryDataList(ctx, in, opts...)
 }
 
-func (m *defaultOrganization) ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error) {
+func (m *defaultOrganization) ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error) {
 	client := pb.NewOrganizationClient(m.cli.Conn())
 	return client.ItemHistoryDataByTime(ctx, in, opts...)
 }

+ 266 - 133
app/cmd/organization/pb/organization.pb.go

@@ -1139,12 +1139,11 @@ type ItemHistoryData struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Id        int64   `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
-	ProjectId int64   `protobuf:"varint,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
-	ItemName  string  `protobuf:"bytes,3,opt,name=item_name,json=itemName,proto3" json:"item_name,omitempty"`
-	Val       float64 `protobuf:"fixed64,4,opt,name=val,proto3" json:"val,omitempty"`
-	CTime     string  `protobuf:"bytes,5,opt,name=c_time,json=cTime,proto3" json:"c_time,omitempty"`
-	HTime     string  `protobuf:"bytes,6,opt,name=h_time,json=hTime,proto3" json:"h_time,omitempty"`
+	ProjectId int64  `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
+	ItemName  string `protobuf:"bytes,2,opt,name=item_name,json=itemName,proto3" json:"item_name,omitempty"`
+	// @gotags: valid:"val"
+	Val   float64 `protobuf:"fixed64,3,opt,name=val,proto3" json:"val,omitempty" valid:"val"`
+	HTime string  `protobuf:"bytes,4,opt,name=h_time,json=hTime,proto3" json:"h_time,omitempty"`
 }
 
 func (x *ItemHistoryData) Reset() {
@@ -1179,13 +1178,6 @@ func (*ItemHistoryData) Descriptor() ([]byte, []int) {
 	return file_organization_proto_rawDescGZIP(), []int{6}
 }
 
-func (x *ItemHistoryData) GetId() int64 {
-	if x != nil {
-		return x.Id
-	}
-	return 0
-}
-
 func (x *ItemHistoryData) GetProjectId() int64 {
 	if x != nil {
 		return x.ProjectId
@@ -1207,13 +1199,6 @@ func (x *ItemHistoryData) GetVal() float64 {
 	return 0
 }
 
-func (x *ItemHistoryData) GetCTime() string {
-	if x != nil {
-		return x.CTime
-	}
-	return ""
-}
-
 func (x *ItemHistoryData) GetHTime() string {
 	if x != nil {
 		return x.HTime
@@ -1226,7 +1211,8 @@ type MultiAddItemHistoryDataReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	List []*ItemHistoryData `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
+	// @gotags: valid:"list"
+	List []*ItemHistoryData `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty" valid:"list"`
 }
 
 func (x *MultiAddItemHistoryDataReq) Reset() {
@@ -1477,9 +1463,9 @@ type ItemHistoryDataMaxMinResp struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	// @inject_tag: json:"max_val"
+	// @gotags: json:"max_val"
 	MaxVal float64 `protobuf:"fixed64,1,opt,name=max_val,json=maxVal,proto3" json:"max_val"`
-	// @inject_tag: json:"min_val"
+	// @gotags: json:"min_val"
 	MinVal float64 `protobuf:"fixed64,2,opt,name=min_val,json=minVal,proto3" json:"min_val"`
 }
 
@@ -1529,6 +1515,118 @@ func (x *ItemHistoryDataMaxMinResp) GetMinVal() float64 {
 	return 0
 }
 
+type ItemHistoryDataList struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	ItemName string `protobuf:"bytes,1,opt,name=item_name,json=itemName,proto3" json:"item_name,omitempty"`
+	// @gotags: json:"val"
+	Val   float64 `protobuf:"fixed64,2,opt,name=val,proto3" json:"val"`
+	HTime string  `protobuf:"bytes,3,opt,name=h_time,json=hTime,proto3" json:"h_time,omitempty"`
+}
+
+func (x *ItemHistoryDataList) Reset() {
+	*x = ItemHistoryDataList{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_organization_proto_msgTypes[12]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ItemHistoryDataList) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ItemHistoryDataList) ProtoMessage() {}
+
+func (x *ItemHistoryDataList) ProtoReflect() protoreflect.Message {
+	mi := &file_organization_proto_msgTypes[12]
+	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 ItemHistoryDataList.ProtoReflect.Descriptor instead.
+func (*ItemHistoryDataList) Descriptor() ([]byte, []int) {
+	return file_organization_proto_rawDescGZIP(), []int{12}
+}
+
+func (x *ItemHistoryDataList) GetItemName() string {
+	if x != nil {
+		return x.ItemName
+	}
+	return ""
+}
+
+func (x *ItemHistoryDataList) GetVal() float64 {
+	if x != nil {
+		return x.Val
+	}
+	return 0
+}
+
+func (x *ItemHistoryDataList) GetHTime() string {
+	if x != nil {
+		return x.HTime
+	}
+	return ""
+}
+
+type ItemHistoryDataListResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	// @gotags: valid:"list"
+	List []*ItemHistoryDataList `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty" valid:"list"`
+}
+
+func (x *ItemHistoryDataListResp) Reset() {
+	*x = ItemHistoryDataListResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_organization_proto_msgTypes[13]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *ItemHistoryDataListResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ItemHistoryDataListResp) ProtoMessage() {}
+
+func (x *ItemHistoryDataListResp) ProtoReflect() protoreflect.Message {
+	mi := &file_organization_proto_msgTypes[13]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use ItemHistoryDataListResp.ProtoReflect.Descriptor instead.
+func (*ItemHistoryDataListResp) Descriptor() ([]byte, []int) {
+	return file_organization_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *ItemHistoryDataListResp) GetList() []*ItemHistoryDataList {
+	if x != nil {
+		return x.List
+	}
+	return nil
+}
+
 var File_organization_proto protoreflect.FileDescriptor
 
 var file_organization_proto_rawDesc = []byte{
@@ -1764,92 +1862,100 @@ var file_organization_proto_rawDesc = []byte{
 	0x0c, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20,
 	0x01, 0x28, 0x03, 0x52, 0x0b, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
 	0x12, 0x15, 0x0a, 0x06, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x49, 0x74, 0x65, 0x6d,
-	0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69,
-	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70,
-	0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x74,
-	0x65, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69,
-	0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x63, 0x5f, 0x74,
-	0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65,
-	0x12, 0x15, 0x0a, 0x06, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x05, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x45, 0x0a, 0x1a, 0x4d, 0x75, 0x6c, 0x74, 0x69,
-	0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61,
-	0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20,
-	0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73,
-	0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x1d,
-	0x0a, 0x1b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
-	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0xd0, 0x01,
-	0x0a, 0x16, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74,
-	0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a,
-	0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72,
-	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x5f,
-	0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d,
-	0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
-	0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72,
-	0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18,
-	0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04,
-	0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65,
-	0x22, 0x82, 0x01, 0x0a, 0x18, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
-	0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a,
-	0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09,
-	0x69, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x08, 0x69, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x69,
-	0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12,
-	0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
-	0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x4d, 0x0a, 0x19, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73,
-	0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x01, 0x52, 0x06, 0x6d, 0x61, 0x78, 0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x6d,
-	0x69, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6d, 0x69,
-	0x6e, 0x56, 0x61, 0x6c, 0x32, 0x93, 0x05, 0x0a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a,
-	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b,
-	0x69, 0x6e, 0x67, 0x55, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62,
-	0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e,
-	0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55, 0x66, 0x12, 0x35, 0x0a, 0x12,
-	0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x42, 0x79, 0x43, 0x6f,
-	0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e,
-	0x67, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e,
-	0x67, 0x52, 0x6f, 0x12, 0x3b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e,
-	0x67, 0x43, 0x68, 0x65, 0x73, 0x74, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70,
-	0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x10,
-	0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x65, 0x73, 0x74,
-	0x12, 0x39, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75,
-	0x6d, 0x70, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63,
-	0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e,
-	0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x12, 0x3b, 0x0a, 0x15, 0x47,
-	0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x79,
-	0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b,
-	0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b,
-	0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x76, 0x65, 0x12, 0x5a, 0x0a, 0x17, 0x4d, 0x75, 0x6c, 0x74,
-	0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44,
-	0x61, 0x74, 0x61, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64,
-	0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
-	0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64,
-	0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x13, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74,
-	0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62,
+	0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x76, 0x0a, 0x0f, 0x49, 0x74, 0x65, 0x6d, 0x48,
+	0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72,
+	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
+	0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x74, 0x65,
+	0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x74,
+	0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x01, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x68, 0x5f, 0x74, 0x69,
+	0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x22,
+	0x45, 0x0a, 0x1a, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48,
+	0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a,
+	0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62,
 	0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
-	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x75, 0x6c,
-	0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
-	0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x55, 0x0a, 0x15, 0x49, 0x74, 0x65, 0x6d, 0x48,
-	0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65,
-	0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
-	0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1e,
-	0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d,
-	0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x5a,
-	0x0a, 0x1b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74,
-	0x61, 0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x2e,
-	0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61,
-	0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62,
-	0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
-	0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
-	0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41,
+	0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74,
+	0x61, 0x52, 0x65, 0x73, 0x70, 0x22, 0xd0, 0x01, 0x0a, 0x16, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
+	0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12,
+	0x1b, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
+	0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+	0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x67, 0x67, 0x72,
+	0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x67,
+	0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x69, 0x6d,
+	0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14,
+	0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65,
+	0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x18, 0x49, 0x74, 0x65,
+	0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69,
+	0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+	0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+	0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x61, 0x6d,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d,
+	0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x05, 0x73, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65,
+	0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x4d, 0x0a,
+	0x19, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
+	0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61,
+	0x78, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6d, 0x61, 0x78,
+	0x56, 0x61, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x6d, 0x69, 0x6e, 0x56, 0x61, 0x6c, 0x22, 0x5b, 0x0a, 0x13,
+	0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c,
+	0x69, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x74, 0x65, 0x6d, 0x4e, 0x61, 0x6d, 0x65,
+	0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x76,
+	0x61, 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x68, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x05, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x46, 0x0a, 0x17, 0x49, 0x74, 0x65,
+	0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74,
+	0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03,
+	0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74,
+	0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73,
+	0x74, 0x32, 0x8d, 0x05, 0x0a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69,
+	0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67,
+	0x55, 0x66, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63,
+	0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x70, 0x62, 0x2e,
+	0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x55, 0x66, 0x12, 0x35, 0x0a, 0x12, 0x47, 0x65, 0x74,
+	0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12,
+	0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65,
+	0x71, 0x1a, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x6f,
+	0x12, 0x3b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68,
+	0x65, 0x73, 0x74, 0x42, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44,
+	0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62,
+	0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a,
+	0x14, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x42,
+	0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72,
+	0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72,
+	0x6b, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x6d, 0x70, 0x12, 0x3b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x57,
+	0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x79, 0x43, 0x6f, 0x64,
+	0x65, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x63, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67,
+	0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67,
+	0x56, 0x61, 0x6c, 0x76, 0x65, 0x12, 0x5a, 0x0a, 0x17, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64,
+	0x64, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61,
+	0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74,
+	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71,
+	0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x49, 0x74,
+	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x4e, 0x0a, 0x13, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
+	0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74,
+	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73,
+	0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
+	0x70, 0x12, 0x52, 0x0a, 0x15, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
+	0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e,
+	0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42,
+	0x79, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74,
+	0x65, 0x6d, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4c, 0x69, 0x73,
+	0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5a, 0x0a, 0x1b, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73,
+	0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x42, 0x79,
+	0x54, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69,
+	0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x42, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x52,
+	0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x48, 0x69, 0x73, 0x74,
+	0x6f, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x78, 0x4d, 0x69, 0x6e, 0x52, 0x65, 0x73,
+	0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x33,
 }
 
 var (
@@ -1864,7 +1970,7 @@ func file_organization_proto_rawDescGZIP() []byte {
 	return file_organization_proto_rawDescData
 }
 
-var file_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
+var file_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
 var file_organization_proto_goTypes = []interface{}{
 	(*DcWorkingReq)(nil),                // 0: pb.DcWorkingReq
 	(*WorkingUf)(nil),                   // 1: pb.WorkingUf
@@ -1878,32 +1984,35 @@ var file_organization_proto_goTypes = []interface{}{
 	(*ItemHistoryDataListReq)(nil),      // 9: pb.ItemHistoryDataListReq
 	(*ItemHistoryDataByTimeReq)(nil),    // 10: pb.ItemHistoryDataByTimeReq
 	(*ItemHistoryDataMaxMinResp)(nil),   // 11: pb.ItemHistoryDataMaxMinResp
+	(*ItemHistoryDataList)(nil),         // 12: pb.ItemHistoryDataList
+	(*ItemHistoryDataListResp)(nil),     // 13: pb.ItemHistoryDataListResp
 }
 var file_organization_proto_depIdxs = []int32{
 	6,  // 0: pb.MultiAddItemHistoryDataReq.list:type_name -> pb.ItemHistoryData
-	0,  // 1: pb.Organization.GetWorkingUfByCode:input_type -> pb.DcWorkingReq
-	0,  // 2: pb.Organization.GetWorkingRoByCode:input_type -> pb.DcWorkingReq
-	0,  // 3: pb.Organization.GetWorkingChestByCode:input_type -> pb.DcWorkingReq
-	0,  // 4: pb.Organization.GetWorkingPumpByCode:input_type -> pb.DcWorkingReq
-	0,  // 5: pb.Organization.GetWorkingValueByCode:input_type -> pb.DcWorkingReq
-	7,  // 6: pb.Organization.MultiAddItemHistoryData:input_type -> pb.MultiAddItemHistoryDataReq
-	9,  // 7: pb.Organization.ItemHistoryDataList:input_type -> pb.ItemHistoryDataListReq
-	10, // 8: pb.Organization.ItemHistoryDataByTime:input_type -> pb.ItemHistoryDataByTimeReq
-	10, // 9: pb.Organization.ItemHistoryDataMaxMinByTime:input_type -> pb.ItemHistoryDataByTimeReq
-	1,  // 10: pb.Organization.GetWorkingUfByCode:output_type -> pb.WorkingUf
-	2,  // 11: pb.Organization.GetWorkingRoByCode:output_type -> pb.WorkingRo
-	3,  // 12: pb.Organization.GetWorkingChestByCode:output_type -> pb.WorkingChest
-	4,  // 13: pb.Organization.GetWorkingPumpByCode:output_type -> pb.WorkingPump
-	5,  // 14: pb.Organization.GetWorkingValueByCode:output_type -> pb.WorkingValve
-	8,  // 15: pb.Organization.MultiAddItemHistoryData:output_type -> pb.MultiAddItemHistoryDataResp
-	7,  // 16: pb.Organization.ItemHistoryDataList:output_type -> pb.MultiAddItemHistoryDataReq
-	7,  // 17: pb.Organization.ItemHistoryDataByTime:output_type -> pb.MultiAddItemHistoryDataReq
-	11, // 18: pb.Organization.ItemHistoryDataMaxMinByTime:output_type -> pb.ItemHistoryDataMaxMinResp
-	10, // [10:19] is the sub-list for method output_type
-	1,  // [1:10] 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
+	12, // 1: pb.ItemHistoryDataListResp.list:type_name -> pb.ItemHistoryDataList
+	0,  // 2: pb.Organization.GetWorkingUfByCode:input_type -> pb.DcWorkingReq
+	0,  // 3: pb.Organization.GetWorkingRoByCode:input_type -> pb.DcWorkingReq
+	0,  // 4: pb.Organization.GetWorkingChestByCode:input_type -> pb.DcWorkingReq
+	0,  // 5: pb.Organization.GetWorkingPumpByCode:input_type -> pb.DcWorkingReq
+	0,  // 6: pb.Organization.GetWorkingValueByCode:input_type -> pb.DcWorkingReq
+	7,  // 7: pb.Organization.MultiAddItemHistoryData:input_type -> pb.MultiAddItemHistoryDataReq
+	9,  // 8: pb.Organization.ItemHistoryDataList:input_type -> pb.ItemHistoryDataListReq
+	10, // 9: pb.Organization.ItemHistoryDataByTime:input_type -> pb.ItemHistoryDataByTimeReq
+	10, // 10: pb.Organization.ItemHistoryDataMaxMinByTime:input_type -> pb.ItemHistoryDataByTimeReq
+	1,  // 11: pb.Organization.GetWorkingUfByCode:output_type -> pb.WorkingUf
+	2,  // 12: pb.Organization.GetWorkingRoByCode:output_type -> pb.WorkingRo
+	3,  // 13: pb.Organization.GetWorkingChestByCode:output_type -> pb.WorkingChest
+	4,  // 14: pb.Organization.GetWorkingPumpByCode:output_type -> pb.WorkingPump
+	5,  // 15: pb.Organization.GetWorkingValueByCode:output_type -> pb.WorkingValve
+	8,  // 16: pb.Organization.MultiAddItemHistoryData:output_type -> pb.MultiAddItemHistoryDataResp
+	13, // 17: pb.Organization.ItemHistoryDataList:output_type -> pb.ItemHistoryDataListResp
+	13, // 18: pb.Organization.ItemHistoryDataByTime:output_type -> pb.ItemHistoryDataListResp
+	11, // 19: pb.Organization.ItemHistoryDataMaxMinByTime:output_type -> pb.ItemHistoryDataMaxMinResp
+	11, // [11:20] is the sub-list for method output_type
+	2,  // [2:11] 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_organization_proto_init() }
@@ -2056,6 +2165,30 @@ func file_organization_proto_init() {
 				return nil
 			}
 		}
+		file_organization_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ItemHistoryDataList); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_organization_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*ItemHistoryDataListResp); 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{
@@ -2063,7 +2196,7 @@ func file_organization_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_organization_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   12,
+			NumMessages:   14,
 			NumExtensions: 0,
 			NumServices:   1,
 		},

+ 10 - 10
app/cmd/organization/pb/organization_grpc.pb.go

@@ -40,8 +40,8 @@ type OrganizationClient interface {
 	GetWorkingPumpByCode(ctx context.Context, in *DcWorkingReq, opts ...grpc.CallOption) (*WorkingPump, error)
 	GetWorkingValueByCode(ctx context.Context, in *DcWorkingReq, opts ...grpc.CallOption) (*WorkingValve, error)
 	MultiAddItemHistoryData(ctx context.Context, in *MultiAddItemHistoryDataReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataResp, error)
-	ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error)
-	ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error)
+	ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error)
+	ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error)
 	ItemHistoryDataMaxMinByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataMaxMinResp, error)
 }
 
@@ -107,8 +107,8 @@ func (c *organizationClient) MultiAddItemHistoryData(ctx context.Context, in *Mu
 	return out, nil
 }
 
-func (c *organizationClient) ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error) {
-	out := new(MultiAddItemHistoryDataReq)
+func (c *organizationClient) ItemHistoryDataList(ctx context.Context, in *ItemHistoryDataListReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error) {
+	out := new(ItemHistoryDataListResp)
 	err := c.cc.Invoke(ctx, Organization_ItemHistoryDataList_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -116,8 +116,8 @@ func (c *organizationClient) ItemHistoryDataList(ctx context.Context, in *ItemHi
 	return out, nil
 }
 
-func (c *organizationClient) ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*MultiAddItemHistoryDataReq, error) {
-	out := new(MultiAddItemHistoryDataReq)
+func (c *organizationClient) ItemHistoryDataByTime(ctx context.Context, in *ItemHistoryDataByTimeReq, opts ...grpc.CallOption) (*ItemHistoryDataListResp, error) {
+	out := new(ItemHistoryDataListResp)
 	err := c.cc.Invoke(ctx, Organization_ItemHistoryDataByTime_FullMethodName, in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -144,8 +144,8 @@ type OrganizationServer interface {
 	GetWorkingPumpByCode(context.Context, *DcWorkingReq) (*WorkingPump, error)
 	GetWorkingValueByCode(context.Context, *DcWorkingReq) (*WorkingValve, error)
 	MultiAddItemHistoryData(context.Context, *MultiAddItemHistoryDataReq) (*MultiAddItemHistoryDataResp, error)
-	ItemHistoryDataList(context.Context, *ItemHistoryDataListReq) (*MultiAddItemHistoryDataReq, error)
-	ItemHistoryDataByTime(context.Context, *ItemHistoryDataByTimeReq) (*MultiAddItemHistoryDataReq, error)
+	ItemHistoryDataList(context.Context, *ItemHistoryDataListReq) (*ItemHistoryDataListResp, error)
+	ItemHistoryDataByTime(context.Context, *ItemHistoryDataByTimeReq) (*ItemHistoryDataListResp, error)
 	ItemHistoryDataMaxMinByTime(context.Context, *ItemHistoryDataByTimeReq) (*ItemHistoryDataMaxMinResp, error)
 	mustEmbedUnimplementedOrganizationServer()
 }
@@ -172,10 +172,10 @@ func (UnimplementedOrganizationServer) GetWorkingValueByCode(context.Context, *D
 func (UnimplementedOrganizationServer) MultiAddItemHistoryData(context.Context, *MultiAddItemHistoryDataReq) (*MultiAddItemHistoryDataResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method MultiAddItemHistoryData not implemented")
 }
-func (UnimplementedOrganizationServer) ItemHistoryDataList(context.Context, *ItemHistoryDataListReq) (*MultiAddItemHistoryDataReq, error) {
+func (UnimplementedOrganizationServer) ItemHistoryDataList(context.Context, *ItemHistoryDataListReq) (*ItemHistoryDataListResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ItemHistoryDataList not implemented")
 }
-func (UnimplementedOrganizationServer) ItemHistoryDataByTime(context.Context, *ItemHistoryDataByTimeReq) (*MultiAddItemHistoryDataReq, error) {
+func (UnimplementedOrganizationServer) ItemHistoryDataByTime(context.Context, *ItemHistoryDataByTimeReq) (*ItemHistoryDataListResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method ItemHistoryDataByTime not implemented")
 }
 func (UnimplementedOrganizationServer) ItemHistoryDataMaxMinByTime(context.Context, *ItemHistoryDataByTimeReq) (*ItemHistoryDataMaxMinResp, error) {

+ 4 - 7
app/model/GtDataStore.sql

@@ -386,16 +386,13 @@ CREATE TABLE `dc_project_config` (
                                      UNIQUE KEY `project_id` (`project_id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
 
-CREATE TABLE `dc_item_history_data` (
-        `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
-        `project_id` int(10) NOT NULL COMMENT '项目ID',
+CREATE TABLE `dc_item_history_data_92` (
         `item_name` varchar(100) NOT NULL DEFAULT '' COMMENT '点位名',
         `val` decimal(10,4) NOT NULL DEFAULT '0' COMMENT '值',
         `h_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '采集数据时间',
-        `c_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-        PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
-        KEY `index_project_item` (`project_id`,`item_name`,`c_time`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='单点位秒级历史数据' /*T![ttl] TTL=`c_time` + INTERVAL 6 MONTH */ /*T![ttl] TTL_ENABLE='ON' */ /*T![ttl] TTL_JOB_INTERVAL='1h' */;
+        PRIMARY KEY (`item_name`,`h_time`) /*T![clustered_index] CLUSTERED */,
+        KEY `index_project_item` (`item_name`,`c_time`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='锡山单点位秒级历史数据' /*T![ttl] TTL=`h_time` + INTERVAL 12 MONTH */ /*T![ttl] TTL_ENABLE='ON' */ /*T![ttl] TTL_JOB_INTERVAL='1h' */;
 
 CREATE TABLE `dc_item_config` (
       `id` int(10) NOT NULL AUTO_INCREMENT,

+ 33 - 12
app/model/dcitemhistorydatamodel.go

@@ -3,10 +3,13 @@ package model
 import (
 	"GtDataStore/app/cmd/organization/pb"
 	"context"
+	"database/sql"
 	"fmt"
 	"github.com/zeromicro/go-zero/core/stores/sqlc"
 	"github.com/zeromicro/go-zero/core/stores/sqlx"
+	"strconv"
 	"strings"
+	"time"
 )
 
 var _ DcItemHistoryDataModel = (*customDcItemHistoryDataModel)(nil)
@@ -17,7 +20,7 @@ type (
 	DcItemHistoryDataModel interface {
 		dcItemHistoryDataModel
 		MultiInsert(ctx context.Context, datas []DcItemHistoryData) (int64, error)
-		QueryHistoryDataByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) ([]DcItemHistoryData, error)
+		QueryHistoryDataByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) ([]ItemHistoryData, error)
 		QueryHistoryDataMaxMinByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) (*MaxMinData, error)
 	}
 
@@ -26,8 +29,14 @@ type (
 	}
 
 	MaxMinData struct {
-		MaxVal float64 `db:"max_val"` // 最大值
-		MinVal float64 `db:"min_val"` // 最小值
+		MaxVal sql.NullFloat64 `db:"max_val"` // 最大值
+		MinVal sql.NullFloat64 `db:"min_val"` // 最小值
+	}
+
+	ItemHistoryData struct {
+		ItemName string    `db:"item_name"` // 点位名
+		Val      float64   `db:"val"`       // 值
+		HTime    time.Time `db:"h_time"`    // 采集数据时间
 	}
 )
 
@@ -39,11 +48,11 @@ func NewDcItemHistoryDataModel(conn sqlx.SqlConn) DcItemHistoryDataModel {
 }
 
 func (m *defaultDcItemHistoryDataModel) MultiInsert(ctx context.Context, datas []DcItemHistoryData) (int64, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?)", m.table, dcItemHistoryDataRowsExpectAutoSet)
+	query := fmt.Sprintf("insert ignore into %s (`item_name`,`val`,`h_time`) values (?, ?, ?)", getTableName(datas[0].ProjectId))
 
 	if bulk, err := sqlx.NewBulkInserter(m.conn, query); err == nil {
 		for _, data := range datas {
-			if err = bulk.Insert(data.ProjectId, data.ItemName, data.Val, data.HTime, data.CTime); err != nil {
+			if err = bulk.Insert(data.ItemName, data.Val, data.HTime); err != nil {
 				return 0, err
 			}
 		}
@@ -55,14 +64,14 @@ func (m *defaultDcItemHistoryDataModel) MultiInsert(ctx context.Context, datas [
 	}
 }
 
-func (m *defaultDcItemHistoryDataModel) QueryHistoryDataByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) ([]DcItemHistoryData, error) {
-	resp := make([]DcItemHistoryData, 0)
+func (m *defaultDcItemHistoryDataModel) QueryHistoryDataByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) ([]ItemHistoryData, error) {
+	resp := make([]ItemHistoryData, 0)
 	var err error
-	query := fmt.Sprintf("SELECT * FROM %s WHERE project_id = ? AND item_name in (?) AND h_time BETWEEN ? AND ? ORDER BY id desc", m.table)
+	query := fmt.Sprintf("SELECT * FROM %s WHERE item_name in (?) AND h_time BETWEEN ? AND ?", getTableName(in.ProjectId))
 	if strings.Index(in.ItemName, ",") > 0 {
-		err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ProjectId, strings.Split(in.ItemName, ","), in.Stime, in.Etime)
+		err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Split(in.ItemName, ","), in.Stime, in.Etime)
 	} else {
-		err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ProjectId, in.ItemName, in.Stime, in.Etime)
+		err = m.conn.QueryRowsCtx(ctx, &resp, query, in.ItemName, in.Stime, in.Etime)
 	}
 
 	switch err {
@@ -78,11 +87,17 @@ func (m *defaultDcItemHistoryDataModel) QueryHistoryDataByTime(ctx context.Conte
 func (m *defaultDcItemHistoryDataModel) QueryHistoryDataMaxMinByTime(ctx context.Context, in *pb.ItemHistoryDataByTimeReq) (*MaxMinData, error) {
 	resp := &MaxMinData{}
 	var err error
-	query := fmt.Sprintf("SELECT max(val) as max_val, min(val) as min_val FROM %s WHERE project_id = ? AND item_name = ? AND h_time BETWEEN ? AND ? ORDER BY id desc", m.table)
-	err = m.conn.QueryRowCtx(ctx, resp, query, in.ProjectId, in.ItemName, in.Stime, in.Etime)
+	query := fmt.Sprintf("SELECT max(val) as max_val, min(val) as min_val FROM %s WHERE item_name = ? AND h_time BETWEEN ? AND ?", getTableName(in.ProjectId))
+	err = m.conn.QueryRowCtx(ctx, resp, query, in.ItemName, in.Stime, in.Etime)
 
 	switch err {
 	case nil:
+		if !resp.MaxVal.Valid {
+			resp.MaxVal.Float64 = 0
+		}
+		if !resp.MinVal.Valid {
+			resp.MinVal.Float64 = 0
+		}
 		return resp, nil
 	case sqlc.ErrNotFound:
 		return nil, ErrNotFound
@@ -91,6 +106,12 @@ func (m *defaultDcItemHistoryDataModel) QueryHistoryDataMaxMinByTime(ctx context
 	}
 }
 
+func getTableName(projectId int64) string {
+	itemDataStr := "dc_item_history_data_"
+	projectStr := strconv.Itoa(int(projectId))
+	return itemDataStr + projectStr
+}
+
 /*
 func (m *defaultDcItemHistoryDataModel) QueryHistoryData(ctx context.Context, in *pb.ItemHistoryDataListReq) ([]DcItemHistoryData, error) {
 	resp := make([]DcItemHistoryData, 0)

+ 15 - 15
app/model/dcitemhistorydatamodel_gen.go

@@ -4,7 +4,7 @@ package model
 
 import (
 	"context"
-	"database/sql"
+
 	"fmt"
 	"strings"
 	"time"
@@ -24,9 +24,9 @@ var (
 
 type (
 	dcItemHistoryDataModel interface {
-		Insert(ctx context.Context, data *DcItemHistoryData) (sql.Result, error)
+		//Insert(ctx context.Context, data *DcItemHistoryData) (sql.Result, error)
 		FindOne(ctx context.Context, id int64) (*DcItemHistoryData, error)
-		Update(ctx context.Context, data *DcItemHistoryData) error
+		//Update(ctx context.Context, data *DcItemHistoryData) error
 		Delete(ctx context.Context, id int64) error
 	}
 
@@ -36,12 +36,12 @@ type (
 	}
 
 	DcItemHistoryData struct {
-		Id        int64     `db:"id"`
+		//Id        int64     `db:"id"`
 		ProjectId int64     `db:"project_id"` // 项目ID
 		ItemName  string    `db:"item_name"`  // 点位名
 		Val       float64   `db:"val"`        // 值
 		HTime     time.Time `db:"h_time"`     // 采集数据时间
-		CTime     time.Time `db:"c_time"`     // 创建时间
+		//CTime     time.Time `db:"c_time"`     // 创建时间
 	}
 )
 
@@ -72,17 +72,17 @@ func (m *defaultDcItemHistoryDataModel) FindOne(ctx context.Context, id int64) (
 	}
 }
 
-func (m *defaultDcItemHistoryDataModel) Insert(ctx context.Context, data *DcItemHistoryData) (sql.Result, error) {
-	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?)", m.table, dcItemHistoryDataRowsExpectAutoSet)
-	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.ItemName, data.Val, data.HTime, data.CTime)
-	return ret, err
-}
+//func (m *defaultDcItemHistoryDataModel) Insert(ctx context.Context, data *DcItemHistoryData) (sql.Result, error) {
+//	query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?)", m.table, dcItemHistoryDataRowsExpectAutoSet)
+//	ret, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.ItemName, data.Val, data.HTime, data.CTime)
+//	return ret, err
+//}
 
-func (m *defaultDcItemHistoryDataModel) Update(ctx context.Context, data *DcItemHistoryData) error {
-	query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, dcItemHistoryDataRowsWithPlaceHolder)
-	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.ItemName, data.Val, data.HTime, data.CTime, data.Id)
-	return err
-}
+//func (m *defaultDcItemHistoryDataModel) Update(ctx context.Context, data *DcItemHistoryData) error {
+//	query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, dcItemHistoryDataRowsWithPlaceHolder)
+//	_, err := m.conn.ExecCtx(ctx, query, data.ProjectId, data.ItemName, data.Val, data.HTime, data.CTime, data.Id)
+//	return err
+//}
 
 func (m *defaultDcItemHistoryDataModel) tableName() string {
 	return m.table