A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat(badge): add comment for event schema
LinkinStars290f63f2a14a
diff --git a/internal/schema/event_schema.go b/internal/schema/event_schema.goindex fd8e06dd..a507f269 100644--- a/internal/schema/event_schema.go+++ b/internal/schema/event_schema.go@@ -38,6 +38,7 @@ type EventMsg struct {ExtraInfo map[string]string}+// NewEvent create a new eventfunc NewEvent(e constant.EventType, userID string) *EventMsg {return &EventMsg{UserID: userID,@@ -46,29 +47,34 @@ func NewEvent(e constant.EventType, userID string) *EventMsg {}}+// QID get question idfunc (e *EventMsg) QID(questionID, userID string) *EventMsg {e.QuestionID = questionIDe.QuestionUserID = userIDreturn e}+// AID get answer idfunc (e *EventMsg) AID(answerID, userID string) *EventMsg {e.AnswerID = answerIDe.AnswerUserID = userIDreturn e}+// CID get comment idfunc (e *EventMsg) CID(comment, userID string) *EventMsg {e.CommentID = commente.CommentUserID = userIDreturn e}+// AddExtra add extra infofunc (e *EventMsg) AddExtra(key, value string) *EventMsg {e.ExtraInfo[key] = valuereturn e}+// GetExtra get extra infofunc (e *EventMsg) GetExtra(key string) string {if v, ok := e.ExtraInfo[key]; ok {return v@@ -76,6 +82,7 @@ func (e *EventMsg) GetExtra(key string) string {return ""}+// GetObjectID get object idfunc (e *EventMsg) GetObjectID() string {if len(e.CommentID) > 0 {return e.CommentID