Browse Source

Ticket

- refactoring
Alexey Kim 1 year ago
parent
commit
382cf12ebd
1 changed files with 18 additions and 0 deletions
  1. 18 0
      v2/ticket.go

+ 18 - 0
v2/ticket.go

@@ -55,3 +55,21 @@ func (x *Ticket) Scan(row driver.Rows) error {
 
 	return nil
 }
+
+func (x *Ticket) MessageIds() []string {
+	var ids []string
+	if v, ok := x.Meta["message_ids"]; ok {
+		_ = json.Unmarshal([]byte(v), &ids)
+	}
+
+	return ids
+}
+
+func (x *Ticket) Subjects() []string {
+	var ids []string
+	if v, ok := x.Meta["subjects"]; ok {
+		_ = json.Unmarshal([]byte(v), &ids)
+	}
+
+	return ids
+}