From 001db1dfd2ead86231007e7fed26c36cdc128897 Mon Sep 17 00:00:00 2001 From: Sinh Date: Wed, 29 Jun 2022 16:57:33 +0700 Subject: [PATCH] save author type to specify role of user --- action_create.go | 2 ++ db_model.go | 1 + 2 files changed, 3 insertions(+) diff --git a/action_create.go b/action_create.go index d8440ec..1ebfa20 100644 --- a/action_create.go +++ b/action_create.go @@ -21,6 +21,7 @@ type CreatePayload struct { type CreatePayloadAuthor struct { ID string Name string + Type string } // Create ... @@ -37,6 +38,7 @@ func (s Service) Create(payload CreatePayload) { Author: Author{ ID: payload.Author.ID, Name: payload.Author.Name, + Type: payload.Author.Type, }, CreatedAt: now(), Message: payload.Message, diff --git a/db_model.go b/db_model.go index 139905e..b84d80d 100644 --- a/db_model.go +++ b/db_model.go @@ -22,4 +22,5 @@ type Audit struct { type Author struct { ID string `bson:"id" json:"id"` Name string `bson:"name" json:"name"` + Type string `bson:"type" json:"type"` } -- 2.34.1