tx_group_in.go 803 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
package group_ev

import (
	"git.hilo.cn/hilo-common/domain"
	"git.hilo.cn/hilo-common/resource/mysql"
)

var txGroupInListen = new(domain.EventBase)

// 进房事件
type TxGroupInEvent struct {
	GroupId    string // imGroupId
	UserId     mysql.ID
	ExternalId string
	Nick       string
	Avatar     string
	IsMember   bool //是否永久成员
	IsVip      bool
	NobleLevel uint16
}

func AddTxGroupInEventSync(callback func(model *domain.Model, event interface{}) error) {
	domain.AddEventSync(txGroupInListen, callback)
}

func AddTxGroupInEventAsync(callback func(model *domain.Model, event interface{}) error) {
	domain.AddEventAsync(txGroupInListen, callback)
}

func PublishTxGroupInEvent(model *domain.Model, event interface{}) error {
	return domain.PublishEvent(txGroupInListen, model, event)
}