新增测点 创建维护模块

This commit is contained in:
2024-09-03 18:00:02 +08:00
parent 3b53e9f9b7
commit 64dc59940d
12 changed files with 230 additions and 15 deletions

View 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"
}