49 lines
1.0 KiB
Go
49 lines
1.0 KiB
Go
package kafka
|
|
|
|
import "context"
|
|
|
|
type Topic interface {
|
|
Name() string
|
|
OnMessage(context.Context) error
|
|
}
|
|
|
|
type TopicQuestionAnswer struct {
|
|
MessageSn int64 `json:"messageSn"`
|
|
USN int64 `json:"usn"`
|
|
QuestionSn int64 `json:"questionSn"`
|
|
QuestionAnswer string `json:"questionAnswer"`
|
|
Answer string `json:"answer"`
|
|
}
|
|
|
|
func (t *TopicQuestionAnswer) Name() string {
|
|
return "qgdzs.question.answer"
|
|
}
|
|
|
|
func (t *TopicQuestionAnswer) OnMessage(_ context.Context) error {
|
|
return nil
|
|
}
|
|
|
|
type TopicAddPoint struct {
|
|
MessageSn int64 `json:"messageSn"`
|
|
Source AddPointSource `json:"source"`
|
|
USN int64 `json:"usn"`
|
|
Point int64 `json:"point"`
|
|
}
|
|
|
|
type AddPointSource int32
|
|
|
|
const (
|
|
AddPointSourceUnKnown AddPointSource = 0
|
|
AddPointSourceRandom AddPointSource = 1
|
|
AddPointSourceCategory AddPointSource = 2
|
|
AddPointSourceQuickly AddPointSource = 3
|
|
)
|
|
|
|
func (t *TopicAddPoint) Name() string {
|
|
return "qgdzs.user.point"
|
|
}
|
|
|
|
func (t *TopicAddPoint) OnMessage(_ context.Context) error {
|
|
return nil
|
|
}
|