aboutsummaryrefslogtreecommitdiff
path: root/entities/base.go
blob: 37d6c308ece3fee75bda82b355ac84b0f08b4834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package entities

import (
	"time"

	"gorm.io/gorm"
)

// BaseModel extends gorm.Model but hides ID and timestamp fields from JSON
type BaseModel struct {
	ID        uint           `gorm:"primarykey" json:"-"`
	CreatedAt time.Time      `json:"-"`
	UpdatedAt time.Time      `json:"-"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}