add jobs
This commit is contained in:
23
backend/app/events/publishers/post_created.go
Normal file
23
backend/app/events/publishers/post_created.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package publishers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"backend/app/events"
|
||||
|
||||
"git.ipao.vip/rogeecn/atom/contracts"
|
||||
)
|
||||
|
||||
var _ contracts.EventPublisher = (*UserRegister)(nil)
|
||||
|
||||
type PostCreated struct {
|
||||
ID int64 `json:"id"`
|
||||
}
|
||||
|
||||
func (e *PostCreated) Marshal() ([]byte, error) {
|
||||
return json.Marshal(e)
|
||||
}
|
||||
|
||||
func (e *PostCreated) Topic() string {
|
||||
return events.TopicPostCreated.String()
|
||||
}
|
||||
Reference in New Issue
Block a user