33 lines
806 B
Go
33 lines
806 B
Go
package domain
|
|
|
|
//Asset is a table structure definition
|
|
type Asset struct {
|
|
ID uint `gorm:"column:device_id;primary_key"`
|
|
UID string `gorm:"column:device_uid"`
|
|
TypeCode string `gorm:"column:device_type_code"`
|
|
SerialNr string `gorm:"column:serial_nr"`
|
|
}
|
|
|
|
// TableName returns the name of the Devices table
|
|
func (Asset) TableName() string {
|
|
return "device"
|
|
}
|
|
|
|
// SortCol represents the sorting column
|
|
type SortCol string
|
|
|
|
// SortCol constants
|
|
const (
|
|
SortColIDAsc SortCol = "id:asc"
|
|
SortColIDDesc SortCol = "id:desc"
|
|
SortColUIDAsc SortCol = "uid:asc"
|
|
SortColUIDDesc SortCol = "uid:desc"
|
|
SortColSerialNrAsc SortCol = "serialnr:asc"
|
|
SortColSerialNrDesc SortCol = "serialnr:desc"
|
|
)
|
|
|
|
// String for SortCol
|
|
func (sc SortCol) String() string {
|
|
return string(sc)
|
|
}
|