package domain //Company is a table structure definition type Company struct { ID uint `gorm:"column:company_id;primary_key"` Name string `gorm:"column:company_name"` Code string `gorm:"column:company_code"` } // TableName returns the name of the Company table func (Company) TableName() string { return "company" } // SortCol represents the sorting column type SortCol string // SortCol constants const ( SortColIDAsc SortCol = "id:asc" SortColIDDesc SortCol = "id:desc" SortColNameAsc SortCol = "name:asc" SortColNameDesc SortCol = "name:desc" ) // String for SortCol func (sc SortCol) String() string { return string(sc) }