update
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
package core
|
||||
|
||||
var Pushs = map[string]func(int, string){}
|
||||
var GroupPushs = map[string]func(int, int, string){}
|
||||
|
||||
func Push(class string, uid int, content string) {
|
||||
if push, ok := Pushs[class]; ok {
|
||||
push(uid, content)
|
||||
}
|
||||
}
|
||||
|
||||
type Chat struct {
|
||||
Class string
|
||||
ID int
|
||||
UserID int
|
||||
}
|
||||
|
||||
func (ct *Chat) Push(content string) {
|
||||
if push, ok := GroupPushs[ct.Class]; ok {
|
||||
push(ct.ID, ct.UserID, content)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user