67 lines
1.9 KiB
Go
67 lines
1.9 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Message struct {
|
|
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"`
|
|
|
|
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"`
|
|
|
|
System bool `bson:"System" json:"system"`
|
|
|
|
CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
|
|
}
|
|
|
|
const (
|
|
StateClose = "close"
|
|
StateOpen = "open"
|
|
StateWait = "wait"
|
|
StateNeedAnswer = "answer"
|
|
)
|
|
|
|
type Ticket struct {
|
|
ID string `bson:"_id" json:"id"`
|
|
UserID string `bson:"UserID" json:"user"`
|
|
SessionID string `bson:"SessionID" json:"sess"`
|
|
AnswererID string `bson:"AnswererID" json:"ans"`
|
|
Origin string `bson:"origin" json:"origin"`
|
|
|
|
State string `bson:"State" json:"state"`
|
|
TopMessage Message `bson:"TopMessage" json:"top_message"`
|
|
|
|
Title string `bson:"Title" json:"title"`
|
|
|
|
CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
|
|
UpdatedAt time.Time `bson:"UpdatedAt" json:"updated_at"`
|
|
|
|
Rate int `bson:"Rate" json:"rate"`
|
|
}
|
|
|
|
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"`
|
|
}
|