recommender/internal/schema/stream.go

23 lines
401 B
Go
Raw Normal View History

2024-11-07 18:25:15 +00:00
package schema
import "encoding/json"
type EventMessage interface {
JSON() ([]byte, error)
}
type ProcessPostRequest struct {
EventMessage
PostId string `json:"post_id"`
Content string `json:"content"`
}
func (p *ProcessPostRequest) JSON() ([]byte, error) {
return json.Marshal(p)
}
type ProcessPostResult struct {
PostId string `json:"post_id"`
Keywords []string `json:"keywords"`
}