message_personal.go
1.0 KB
package domain
import "time"
// MessagePersonal 个人的消息提示
type MessagePersonal struct {
Id int `json:"id"` //
Types MessageTypes `json:"types"` //消息类型
TargetUserId int `json:"targetUserId"` //消息指向的用户
ReadFlag MessageReadFlag `json:"readFlag"` //1:已读、2:未读
Title string `json:"title"` //消息的标题
Content string `json:"content"` //消息的内容
CreatedAt time.Time `json:"createdAt"` //
UpdatedAt time.Time `json:"updatedAt"` //
Payload string `json:"payload"` //消息的额外承载的数据
}
type MessageTypes string
const (
MessageTypesOther MessageTypes = "other"
)
type MessageReadFlag string
const (
MessageIsRead MessageReadFlag = "read"
MessageUnread MessageReadFlag = "unread"
)
type MessagePersonalRepository interface {
Save(param *MessagePersonal) error
Find(queryOptions map[string]interface{}) (int, []*MessagePersonal, error)
}