Merge pull request #3 from Selly-Modules/save-audit-msg

save audit message
This commit is contained in:
Sinh Luu 2022-06-29 11:43:25 +07:00 committed by GitHub
commit 6e1a1784a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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 ...