feat 包命名规范
This commit is contained in:
@@ -20,15 +20,7 @@ func startConsumer() {
|
||||
}
|
||||
|
||||
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"
|
||||
kafka.TopicQuestionAnswer
|
||||
}
|
||||
|
||||
func (t *TopicQuestionAnswer) OnMessage(ctx context.Context) error {
|
||||
@@ -60,23 +52,7 @@ func (t *TopicQuestionAnswer) OnMessage(ctx context.Context) error {
|
||||
}
|
||||
|
||||
type TopicAddPoint struct {
|
||||
MessageSn int64 `json:"messageSn"`
|
||||
Source AddPointSource `json:"source"`
|
||||
USN int64 `json:"usn"`
|
||||
Point int64 `json:"point"`
|
||||
}
|
||||
|
||||
type AddPointSource int32
|
||||
|
||||
const (
|
||||
AddPointSourceUnKnown = 0
|
||||
AddPointSourceRandom = 1
|
||||
AddPointSourceCategory = 2
|
||||
AddPointSourceQuickly = 3
|
||||
)
|
||||
|
||||
func (t *TopicAddPoint) Name() string {
|
||||
return "qgdzs.user.point"
|
||||
kafka.TopicAddPoint
|
||||
}
|
||||
|
||||
func (t *TopicAddPoint) OnMessage(ctx context.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user