From 48fa66bf614dc3fc933146ebb6dced458a560378 Mon Sep 17 00:00:00 2001 From: Sinh Date: Wed, 29 Jun 2022 11:34:17 +0700 Subject: [PATCH] save audit message --- action_create.go | 2 ++ db_model.go | 1 + 2 files changed, 3 insertions(+) diff --git a/action_create.go b/action_create.go index e7854d6..d8440ec 100644 --- a/action_create.go +++ b/action_create.go @@ -13,6 +13,7 @@ type CreatePayload struct { TargetID string Action string Data string + Message string Author CreatePayloadAuthor } @@ -38,6 +39,7 @@ func (s Service) Create(payload CreatePayload) { Name: payload.Author.Name, }, CreatedAt: now(), + Message: payload.Message, } // Insert to db diff --git a/db_model.go b/db_model.go index e0aaecf..139905e 100644 --- a/db_model.go +++ b/db_model.go @@ -15,6 +15,7 @@ type Audit struct { Data string `bson:"data" json:"data"` Author Author `bson:"author" json:"author"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` + Message string `bson:"message" json:"message"` } // Author ... -- 2.34.1