Files
energy-management-system/model/device_point.go
2024-09-03 15:52:38 +08:00

24 lines
976 B
Go

package model
import (
"energy-management-system/global"
"gorm.io/gorm"
"time"
)
// DevicePoint 设备测点配置
type DevicePoint struct {
Id int `gorm:"column:id;primaryKey" json:"id"`
DriverId int `gorm:"column:driver_id;comment:设备ID" json:"driver_id"`
PointId int `gorm:"column:point_id;comment:测点ID" json:"point_id"`
EnergyType int `gorm:"column:energy_type;comment:能源类型" json:"energy_type"`
PointNameId int `gorm:"column:point_name_id;comment:测点名称ID" json:"point_name_id"`
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 *DevicePoint) TableName() string {
return global.AppConf.Db.TablePrefix + "device_point_configs"
}