feat: new event

This commit is contained in:
Rogee
2025-01-15 19:30:01 +08:00
parent b5d6593fa4
commit 57f8e95d50
7 changed files with 185 additions and 60 deletions

View File

@@ -0,0 +1,23 @@
package publishers
import (
"encoding/json"
"{{.ModuleName}}/app/events"
"git.ipao.vip/rogeecn/atom/contracts"
)
var _ contracts.EventPublisher = (*{{.Name}}Event)(nil)
type {{.Name}}Event struct {
ID int64 `json:"id"`
}
func (e *{{.Name}}Event) Marshal() ([]byte, error) {
return json.Marshal(e)
}
func (e *{{.Name}}Event) Topic() string {
return events.Topic{{.Name}}
}