Răsfoiți Sursa

Ticket

- add `created_at` and `updated_at` fields
Alexey Kim 1 an în urmă
părinte
comite
ea77723239
2 a modificat fișierele cu 61 adăugiri și 33 ștergeri
  1. 59 33
      v2/ticket.pb.go
  2. 2 0
      v2/ticket.proto

+ 59 - 33
v2/ticket.pb.go

@@ -524,14 +524,16 @@ type Ticket struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	TicketId string            `protobuf:"bytes,1,opt,name=ticket_id,proto3" json:"ticket_id,omitempty"`
-	ThreadId string            `protobuf:"bytes,2,opt,name=thread_id,proto3" json:"thread_id,omitempty"`
-	To       string            `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`
-	From     *EmailAddress     `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
-	Flags    []byte            `protobuf:"bytes,5,opt,name=flags,proto3" json:"flags,omitempty"`
-	Messages []*Message        `protobuf:"bytes,10,rep,name=messages,proto3" json:"messages,omitempty"`
-	Meta     map[string]string `protobuf:"bytes,11,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
-	Tags     []string          `protobuf:"bytes,12,rep,name=tags,proto3" json:"tags,omitempty"`
+	TicketId  string                 `protobuf:"bytes,1,opt,name=ticket_id,proto3" json:"ticket_id,omitempty"`
+	ThreadId  string                 `protobuf:"bytes,2,opt,name=thread_id,proto3" json:"thread_id,omitempty"`
+	To        string                 `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`
+	From      *EmailAddress          `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"`
+	Flags     []byte                 `protobuf:"bytes,5,opt,name=flags,proto3" json:"flags,omitempty"`
+	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,proto3" json:"created_at,omitempty"`
+	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,proto3" json:"updated_at,omitempty"`
+	Messages  []*Message             `protobuf:"bytes,10,rep,name=messages,proto3" json:"messages,omitempty"`
+	Meta      map[string]string      `protobuf:"bytes,11,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+	Tags      []string               `protobuf:"bytes,12,rep,name=tags,proto3" json:"tags,omitempty"`
 }
 
 func (x *Ticket) Reset() {
@@ -601,6 +603,20 @@ func (x *Ticket) GetFlags() []byte {
 	return nil
 }
 
+func (x *Ticket) GetCreatedAt() *timestamppb.Timestamp {
+	if x != nil {
+		return x.CreatedAt
+	}
+	return nil
+}
+
+func (x *Ticket) GetUpdatedAt() *timestamppb.Timestamp {
+	if x != nil {
+		return x.UpdatedAt
+	}
+	return nil
+}
+
 func (x *Ticket) GetMessages() []*Message {
 	if x != nil {
 		return x.Messages
@@ -695,7 +711,7 @@ var file_ticket_proto_rawDesc = []byte{
 	0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54,
 	0x45, 0x58, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x02,
 	0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53, 0x49, 0x53, 0x54, 0x41, 0x4e, 0x54, 0x5f, 0x43, 0x41,
-	0x4c, 0x4c, 0x42, 0x41, 0x43, 0x4b, 0x10, 0x03, 0x22, 0xbc, 0x02, 0x0a, 0x06, 0x54, 0x69, 0x63,
+	0x4c, 0x4c, 0x42, 0x41, 0x43, 0x4b, 0x10, 0x03, 0x22, 0xb4, 0x03, 0x0a, 0x06, 0x54, 0x69, 0x63,
 	0x6b, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64,
 	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69,
 	0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02,
@@ -705,23 +721,31 @@ var file_ticket_proto_rawDesc = []byte{
 	0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x64, 0x64, 0x72,
 	0x65, 0x73, 0x73, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61,
 	0x67, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12,
-	0x2b, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28,
-	0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61,
-	0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x04,
-	0x6d, 0x65, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x69, 0x63,
-	0x6b, 0x65, 0x74, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45,
-	0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61,
-	0x67, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x1a, 0x37,
-	0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
-	0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
-	0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61,
-	0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x2f, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12,
-	0x0f, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x1a, 0x02, 0x08, 0x01,
-	0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x4f,
-	0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x02, 0x42, 0x2d, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e,
-	0x67, 0x73, 0x68, 0x6f, 0x70, 0x70, 0x65, 0x72, 0x2e, 0x63, 0x72, 0x6d, 0x2e, 0x74, 0x69, 0x63,
-	0x6b, 0x65, 0x74, 0x2e, 0x76, 0x32, 0x42, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x08, 0x2e,
-	0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x3a, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20,
+	0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
+	0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x12, 0x3a, 0x0a, 0x0a, 0x75,
+	0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
+	0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+	0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64,
+	0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x12, 0x2b, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x69, 0x63, 0x6b,
+	0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x03,
+	0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x54, 0x69, 0x63, 0x6b,
+	0x65, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65,
+	0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09,
+	0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x1a, 0x37, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e,
+	0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a,
+	0x2f, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x0f, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f,
+	0x77, 0x6e, 0x10, 0x00, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, 0x4e, 0x54,
+	0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x02,
+	0x42, 0x2d, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x73, 0x68, 0x6f, 0x70, 0x70, 0x65, 0x72,
+	0x2e, 0x63, 0x72, 0x6d, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x32, 0x42, 0x05,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x08, 0x2e, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x62,
+	0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
@@ -762,13 +786,15 @@ var file_ticket_proto_depIdxs = []int32{
 	8,  // 6: ticket.Message.headers:type_name -> ticket.Message.HeadersEntry
 	9,  // 7: ticket.Message.meta:type_name -> ticket.Message.MetaEntry
 	2,  // 8: ticket.Ticket.from:type_name -> ticket.EmailAddress
-	6,  // 9: ticket.Ticket.messages:type_name -> ticket.Message
-	10, // 10: ticket.Ticket.meta:type_name -> ticket.Ticket.MetaEntry
-	11, // [11:11] is the sub-list for method output_type
-	11, // [11:11] is the sub-list for method input_type
-	11, // [11:11] is the sub-list for extension type_name
-	11, // [11:11] is the sub-list for extension extendee
-	0,  // [0:11] is the sub-list for field type_name
+	11, // 9: ticket.Ticket.created_at:type_name -> google.protobuf.Timestamp
+	11, // 10: ticket.Ticket.updated_at:type_name -> google.protobuf.Timestamp
+	6,  // 11: ticket.Ticket.messages:type_name -> ticket.Message
+	10, // 12: ticket.Ticket.meta:type_name -> ticket.Ticket.MetaEntry
+	13, // [13:13] is the sub-list for method output_type
+	13, // [13:13] is the sub-list for method input_type
+	13, // [13:13] is the sub-list for extension type_name
+	13, // [13:13] is the sub-list for extension extendee
+	0,  // [0:13] is the sub-list for field type_name
 }
 
 func init() { file_ticket_proto_init() }

+ 2 - 0
v2/ticket.proto

@@ -70,6 +70,8 @@ message Ticket {
   string to = 3 [json_name = "to"];
   EmailAddress from = 4 [json_name = "from"];
   bytes flags = 5 [json_name = "flags"];
+  google.protobuf.Timestamp created_at = 6 [json_name = "created_at"];
+  google.protobuf.Timestamp updated_at = 7 [json_name = "updated_at"];
 
   repeated Message messages = 10 [json_name = "messages"];
   map<string, string> meta = 11 [json_name = "meta"];