save audit message #3

Merged
luuvansinh merged 1 commits from save-audit-msg into master 2022-06-29 04:43:26 +00:00
2 changed files with 3 additions and 0 deletions
Showing only changes of commit 48fa66bf61 - Show all commits

View File

@ -13,6 +13,7 @@ type CreatePayload struct {
TargetID string TargetID string
Action string Action string
Data string Data string
Message string
Author CreatePayloadAuthor Author CreatePayloadAuthor
} }
@ -38,6 +39,7 @@ func (s Service) Create(payload CreatePayload) {
Name: payload.Author.Name, Name: payload.Author.Name,
}, },
CreatedAt: now(), CreatedAt: now(),
Message: payload.Message,
} }
// Insert to db // Insert to db

View File

@ -15,6 +15,7 @@ type Audit struct {
Data string `bson:"data" json:"data"` Data string `bson:"data" json:"data"`
Author Author `bson:"author" json:"author"` Author Author `bson:"author" json:"author"`
CreatedAt time.Time `bson:"createdAt" json:"createdAt"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"`
Message string `bson:"message" json:"message"`
} }
// Author ... // Author ...