heruvym/model/model.go

42 lines
1.2 KiB
Go
Raw Normal View History

2021-04-10 18:46:51 +00:00
package model
import "time"
type Message struct {
2021-05-11 17:23:13 +00:00
ID string `bson:"_id" json:"id"`
TicketID string `bson:"TicketID" json:"ticket_id"`
UserID string `bson:"UserID" json:"user_id"`
SessionID string `bson:"SessionID" json:"session_id"`
2021-04-10 18:46:51 +00:00
2021-05-11 17:23:13 +00:00
Message string `bson:"Message" json:"message"`
Files []string `bson:"Files" json:"files"`
Shown map[string]int `bson:"Shown" json:"shown"`
2022-02-27 15:27:44 +00:00
RequestScreenshot string `bson:"RequestScreenshot" json:"request_screenshot"`
2021-04-11 09:48:15 +00:00
2021-05-11 17:23:13 +00:00
CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
2021-04-11 09:48:15 +00:00
}
2021-05-02 22:25:12 +00:00
const (
StateClose = "close"
StateOpen = "open"
StateWait = "wait"
StateNeedAnswer = "answer"
)
2021-04-11 09:48:15 +00:00
type Ticket struct {
2021-05-11 17:23:13 +00:00
ID string `bson:"_id" json:"id"`
UserID string `bson:"UserID" json:"user"`
SessionID string `bson:"SessionID" json:"sess"`
AnswererID string `bson:"AnswererID" json:"ans"`
2021-04-10 18:46:51 +00:00
2021-05-11 17:23:13 +00:00
State string `bson:"State" json:"state"`
TopMessage Message `bson:"TopMessage" json:"top_message"`
2021-05-02 22:25:12 +00:00
2021-05-11 17:23:13 +00:00
Title string `bson:"Title" json:"title"`
2021-04-10 18:46:51 +00:00
2021-05-11 17:23:13 +00:00
CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
UpdatedAt time.Time `bson:"UpdatedAt" json:"updated_at"`
2021-05-11 10:57:58 +00:00
2021-05-11 17:23:13 +00:00
Rate int `bson:"Rate" json:"rate"`
2021-04-10 18:46:51 +00:00
}