完善季度
This commit is contained in:
23
model/peak-valley/peak_valley_quarter.go
Normal file
23
model/peak-valley/peak_valley_quarter.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package peak_valley
|
||||
|
||||
import (
|
||||
"energy-management-system/global"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PeakValleyQuarter struct {
|
||||
Id uint `gorm:"column:id;primaryKey" json:"id"`
|
||||
QuarterName string `gorm:"column:quarter_name;comment:季度名称" json:"quarter_name"`
|
||||
StartTime time.Time `gorm:"column:start_time;type:date;comment:开始时间" json:"start_time"`
|
||||
EndTime time.Time `gorm:"column:end_time;type:date;comment:结束时间" json:"end_time"`
|
||||
Rid uint `gorm:"column:rid;comment:季度使用规则" json:"rid"`
|
||||
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:"-"`
|
||||
Rule PeakValleyRule `gorm:"foreignKey:rid;references:rule_id"`
|
||||
}
|
||||
|
||||
func (r *PeakValleyQuarter) TableName() string {
|
||||
return global.AppConf.Db.TablePrefix + "peak_valley_quarters"
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package peak_valley
|
||||
|
||||
import (
|
||||
"energy-management-system/global"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 季度谷峰规则
|
||||
|
||||
// 开始时间
|
||||
// 结束时间
|
||||
// 谷峰规则ID
|
||||
|
||||
type PeakValleyQuarterRule struct {
|
||||
RuleId uint `gorm:"column:rule_id;primaryKey" json:"rule_id"`
|
||||
StartTime uint `gorm:"column:start_time;comment:开始时间" json:"start_time"`
|
||||
EndTime uint `gorm:"column:end_time;comment:结束时间" json:"end_time"`
|
||||
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 *PeakValleyQuarterRule) TableName() string {
|
||||
return global.AppConf.Db.TablePrefix + "peak_valley_quarter_rules"
|
||||
}
|
||||
Reference in New Issue
Block a user