From d958737cd0cfc9e589179ec747279bf0dd2e99fc Mon Sep 17 00:00:00 2001 From: Akecel Date: Sun, 11 Oct 2020 12:31:04 +0200 Subject: [PATCH] feat(Model) : add JSON formatter in gorm Model --- model.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model.go b/model.go index 3334d17c..49fa0787 100644 --- a/model.go +++ b/model.go @@ -8,8 +8,8 @@ import "time" // gorm.Model // } type Model struct { - ID uint `gorm:"primarykey"` - CreatedAt time.Time - UpdatedAt time.Time - DeletedAt DeletedAt `gorm:"index"` + ID uint `json:"id" gorm:"primarykey"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + DeletedAt DeletedAt `json:"deleted_at" gorm:"index"` }