Documentation ¶
Index ¶
Constants ¶
View Source
const ( Info = iota + 1 Success Warning Error )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Notification ¶
type Notification[T primary.Key] struct { Message map[T]chan *Records[T] *NotifyMapper[T] // contains filtered or unexported fields }
func (*Notification[T]) GetNotify ¶
func (notify *Notification[T]) GetNotify(id T) chan *Records[T]
GetNotify 获取用户的消息通知通道
func (*Notification[T]) New ¶
func (notify *Notification[T]) New(level int, id T, title, text string) *Records[T]
func (*Notification[T]) Publish ¶
func (notify *Notification[T]) Publish(records *Records[T], user T, ids ...T)
Publish 发送消息给指定的 ids
type NotifyMapper ¶
type Records ¶
type Records[T primary.Key] struct { Id T `column:"id"` PubId T `column:"pub_id"` // 生产者 SubId T `column:"sub_id"` // 消费者 Title string `column:"title"` // 消息标题 MsgType int `column:"msg_type"` // 消息类型 Text string `column:"text"` // 消息文本 Template string `column:"template"` // 消息模版 Data string `column:"data"` // 模版上下文数据 Status int `column:"status"` // 消息状态 Del int `column:"del"` CreateTime string `column:"create_time"` // 消息生成时间 HandleTime string `column:"handle_time"` // 消息处理时间 }
Click to show internal directories.
Click to hide internal directories.