init
This commit is contained in:
25
model/device.go
Normal file
25
model/device.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"DT/global"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Device struct {
|
||||
Id int `gorm:"column:id;primaryKey" json:"id"`
|
||||
//DriverId string `gorm:"column:driver_id;comment:设备ID;type:varchar(255)" json:"driver_id"`
|
||||
Imei string `gorm:"column:imei;comment:IMEI;type:varchar(255)" json:"imei"`
|
||||
//DriverName string `gorm:"column:driver_name;comment:设备名称;type:varchar(255)" json:"driver_name"`
|
||||
DriverPass string `gorm:"column:driver_pass;comment:设备密码;type:varchar(255)" json:"driver_pass"`
|
||||
DriverVer string `gorm:"column:driver_ver;comment:固件版本;type:varchar(255)" json:"driver_ver"`
|
||||
//DriverFd string `gorm:"column:driver_fd;comment:设备FD;type:varchar(255)" json:"driver_fd"`
|
||||
Remark string `gorm:"column:remark;comment:备注;type:varchar(255)" json:"remark"`
|
||||
Created time.Time `gorm:"column:created;autoCreateTime;comment:创建时间" json:"created"`
|
||||
Updated time.Time `gorm:"column:updated;autoUpdateTime;comment:修改时间" json:"updated"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"-"`
|
||||
}
|
||||
|
||||
func (r *Device) TableName() string {
|
||||
return global.AppConf.Db.TablePrefix + "devices"
|
||||
}
|
||||
Reference in New Issue
Block a user