51 lines
1.0 KiB
Go
51 lines
1.0 KiB
Go
package model
|
|
|
|
const (
|
|
MessageTypeStore = 1
|
|
)
|
|
|
|
const (
|
|
MessageStatusNew = 0
|
|
MessageStatusSendAllSuccess = 1
|
|
MessageStatusSendSuccess = 2
|
|
MessageStatusSendAllFailed = 3
|
|
)
|
|
|
|
var (
|
|
StoreMsgSendStatusName = map[int]string{
|
|
MessageStatusNew: "发送中",
|
|
MessageStatusSendAllSuccess: "成功",
|
|
MessageStatusSendSuccess: "部分成功",
|
|
MessageStatusSendAllFailed: "失败",
|
|
}
|
|
)
|
|
|
|
type Message struct {
|
|
ModelIDCULD
|
|
Type int8 `json:"type"`
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
func (*Message) TableIndex() [][]string {
|
|
return [][]string{
|
|
[]string{"CreatedAt"},
|
|
[]string{"DeletedAt"},
|
|
}
|
|
}
|
|
|
|
type MessageStatus struct {
|
|
ModelIDCULD
|
|
MessageID int `orm:"column(message_id)" json:"messageID"`
|
|
StoreID int `orm:"column(store_id)" json:"storeID"`
|
|
Status int8 `json:"status"`
|
|
ReadCount int `json:"readCount"`
|
|
}
|
|
|
|
func (*MessageStatus) TableIndex() [][]string {
|
|
return [][]string{
|
|
[]string{"MessageID", "Status"},
|
|
[]string{"StoreID", "MessageID", "Status"},
|
|
}
|
|
}
|