Files
wallet-go-api/pkg/models/db.go
Fran Jurmanović cc98d0cf49 fixes on structuring
2021-05-15 22:23:30 +02:00

21 lines
386 B
Go

package models
import (
"time"
"github.com/google/uuid"
)
type CommonModel struct {
Id string `json:"id" pg:"id,pk"`
DateCreated time.Time `json:"dateCreated" pg:"datecreated"`
DateUpdated time.Time `json:"dateUpdated" pg:"dateupdated"`
}
func (cm *CommonModel) Init() {
date := time.Now()
cm.Id = uuid.NewString()
cm.DateCreated = date
cm.DateUpdated = date
}