28 lines
495 B
Go
28 lines
495 B
Go
package events
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"git.ipao.vip/rogeecn/atom/contracts"
|
|
)
|
|
|
|
var _ contracts.EventPublisher = (*UserRegister)(nil)
|
|
|
|
type UserRegister struct {
|
|
ID int64 `json:"id"`
|
|
}
|
|
|
|
func (e *UserRegister) Prepare() error {
|
|
return nil
|
|
}
|
|
|
|
// Marshal implements contracts.EventPublisher.
|
|
func (e *UserRegister) Marshal() ([]byte, error) {
|
|
return json.Marshal(e)
|
|
}
|
|
|
|
// Topic implements contracts.EventHandler.
|
|
func (e *UserRegister) Topic() string {
|
|
return TopicUserRegister.String()
|
|
}
|