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

30 lines
998 B
Go

package peak_valley
import (
"energy-management-system/global"
"gorm.io/gorm"
"time"
)
// 一天的完整谷峰规则
// 发电 (光伏)
// 用电 (电机、生产)
//新建规则
//
//选择时间段 设置电价
//(将时间段 转化为十分钟区块 查找到对应十分钟区块 创建该规则的电价)
type PeakValleyRule struct {
RuleId int `gorm:"column:rule_id;primaryKey" json:"rule_id"`
RuleName string `gorm:"column:rule_name;comment:规则名称" json:"rule_name"`
Description string `gorm:"column:description;comment:描述" json:"description"`
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 *PeakValleyRule) TableName() string {
return global.AppConf.Db.TablePrefix + "peak_valley_rules"
}