heruvym/internal/model/model.go

67 lines
1.9 KiB
Go
Raw Permalink 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
Message string `bson:"Message" json:"message"`
Files []string `bson:"Files" json:"files"`
Shown map[string]int `bson:"Shown" json:"shown"`
RequestScreenshot string `bson:"RequestScreenshot" json:"request_screenshot"`
2021-04-11 09:48:15 +00:00
2024-10-02 13:36:49 +00:00
System bool `bson:"System" json:"system"`
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"`
2024-10-02 13:36:49 +00:00
Origin string `bson:"origin" json:"origin"`
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
}
type Account struct {
ID string `json:"_id" bson:"_id"`
UserID string `json:"userId" bson:"userId"`
Nickname string `json:"nickname" bson:"nickname"`
Avatar string `json:"avatar" bson:"avatar"`
Role string `json:"role" bson:"role"`
IsDeleted bool `json:"isDeleted" bson:"isDeleted"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"`
}
type AccountPage struct {
Count int64 `json:"count" bson:"count"`
Items []Account `json:"items"`
}
type RespErrorValidate struct {
Field string `json:"field"`
Tag string `json:"tag"`
Value string `json:"value"`
}