新增测点 创建维护模块
This commit is contained in:
23
model/device-point/device_point.go
Normal file
23
model/device-point/device_point.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package device_point
|
||||
|
||||
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"
|
||||
}
|
||||
20
model/device-point/point_name.go
Normal file
20
model/device-point/point_name.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package device_point
|
||||
|
||||
import (
|
||||
"energy-management-system/global"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// PointName 测点名称
|
||||
type PointName struct {
|
||||
Id int `gorm:"column:id;primaryKey" json:"id"`
|
||||
Name string `gorm:"column:name;comment:测点名称" json:"name"`
|
||||
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 *PointName) TableName() string {
|
||||
return global.AppConf.Db.TablePrefix + "point_names"
|
||||
}
|
||||
Reference in New Issue
Block a user