feat sn 改成 int64
This commit is contained in:
@@ -20,9 +20,9 @@ func startConsumer() {
|
||||
}
|
||||
|
||||
type TopicQuestionAnswer struct {
|
||||
MessageSn string `json:"messageSn"`
|
||||
USN string `json:"usn"`
|
||||
QuestionSn string `json:"questionSn"`
|
||||
MessageSn int64 `json:"messageSn"`
|
||||
USN int64 `json:"usn"`
|
||||
QuestionSn int64 `json:"questionSn"`
|
||||
QuestionAnswer string `json:"questionAnswer"`
|
||||
Answer string `json:"answer"`
|
||||
}
|
||||
@@ -33,7 +33,7 @@ func (t *TopicQuestionAnswer) Name() string {
|
||||
|
||||
func (t *TopicQuestionAnswer) OnMessage(ctx context.Context) error {
|
||||
log.Infof("Kafka consume topic: %v: %#+v", t.Name(), t)
|
||||
if t.USN == "" || t.QuestionSn == "" {
|
||||
if t.USN == 0 || t.QuestionSn == 0 {
|
||||
return utils.ErrorsWrap(errors.New("invalid data"))
|
||||
}
|
||||
|
||||
@@ -60,9 +60,9 @@ func (t *TopicQuestionAnswer) OnMessage(ctx context.Context) error {
|
||||
}
|
||||
|
||||
type TopicAddPoint struct {
|
||||
MessageSn string `json:"messageSn"`
|
||||
MessageSn int64 `json:"messageSn"`
|
||||
Source AddPointSource `json:"source"`
|
||||
USN string `json:"usn"`
|
||||
USN int64 `json:"usn"`
|
||||
Point int64 `json:"point"`
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ func (t *TopicAddPoint) Name() string {
|
||||
|
||||
func (t *TopicAddPoint) OnMessage(ctx context.Context) error {
|
||||
log.Infof("Kafka consume topic: %v: %#+v", t.Name(), t)
|
||||
if t.USN == "" || t.Point == 0 {
|
||||
if t.USN == 0 || t.Point == 0 {
|
||||
return utils.ErrorsWrap(errors.New("invalid data"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user