feat 包命名规范

This commit is contained in:
2026-02-11 14:49:46 +08:00
parent 1a42e055ae
commit 77cc02fc95
12 changed files with 65 additions and 92 deletions

View File

@@ -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 {