35 lines
672 B
Go
35 lines
672 B
Go
package core
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Base struct {
|
|
CreatedAt time.Time `json:"createdAt" gorm:"column:CreatedAt;type:timestamptz"`
|
|
UpdatedAt time.Time `json:"updatedAt" gorm:"column:UpdatedAt;type:timestamptz"`
|
|
DeletedAt gorm.DeletedAt `json:"deletedAt,omitempty" gorm:"column:DeletedAt"`
|
|
}
|
|
|
|
type Main struct {
|
|
Id uint `json:"id" gorm:"primaryKey"` // depends on the system architecture
|
|
Base
|
|
}
|
|
|
|
type TinyMain struct {
|
|
Id uint8 `json:"id" gorm:"primaryKey"`
|
|
Base
|
|
}
|
|
|
|
type SmallMain struct {
|
|
Id uint16 `json:"id" gorm:"primaryKey"`
|
|
Base
|
|
}
|
|
|
|
// Mainly for transaction
|
|
type BigMain struct {
|
|
Id uint64 `json:"id" gorm:"primaryKey"`
|
|
Base
|
|
}
|