feat 包命名规范

This commit is contained in:
2026-02-11 14:48:21 +08:00
parent 0ca8a0ccbb
commit 558677bc3a
30 changed files with 162 additions and 123 deletions

View File

@@ -6,3 +6,43 @@ 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
}