package model import ( "git.getensh.com/common/gopkgsv2/database" "gorm.io/gorm" ) type Ads18Model interface { Get(db *gorm.DB) (*Ads18, error) } type Ads18 struct { ID int64 `gorm:"column:id" json:"id"` ModelNo string `gorm:"column:model_no" json:"model_no"` PlateType string `gorm:"column:plate_type" json:"plate_type"` VehicleType string `gorm:"column:vehicle_type" json:"vehicle_type"` VehicleTypeDetail string `gorm:"column:vehicle_type_detail" json:"vehicle_type_detail"` CreatedAt int64 `gorm:"column:created_at" json:"created_at"` UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"` } type defaultAds18Model struct { tableName string fields string } func NewAds18Model() Ads18Model { return &defaultAds18Model{ "db_adm_ads.t_adm_ads18", "id, model_no, plate_type, vehicle_type, vehicle_type_detail", } } func (d *defaultAds18Model) Get(db *gorm.DB) (*Ads18, error) { var res Ads18 err := database.Get(db, &res, database.Option{ TableName: d.tableName, }) return &res, err }