package
Version:
v1.5.10
Opens a new window with list of versions in this module.
Published: Sep 8, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
View Source
var (
CreateTimeAsc = Asc(createTime)
UpdateTimeAsc = Asc(updateTime)
CreateTimeDesc = Desc(createTime)
UpdateTimeDesc = Desc(updateTime)
IdDesc = Desc(id)
)
const (
MySQL DbType = "mysql"
Postgres DbType = "postgres"
)
type Model struct {
ID uint `gorm:"primaryKey;index" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
Model primary key is auto increment
type Operator struct {
CreatedBy string `json:"created_by"`
UpdatedBy string `json:"updated_by"`
DeletedBy string `json:"deleted_by"`
}
type UModel struct {
ID string `gorm:"primaryKey;index" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
UModel primary key is uuid model
Source Files
¶
Click to show internal directories.
Click to hide internal directories.