init
This commit is contained in:
20
form/page.go
Normal file
20
form/page.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package form
|
||||
|
||||
type Page struct {
|
||||
PageIndex int `form:"page_index" json:"page_index"`
|
||||
PageSize int `form:"page_size" json:"page_size"`
|
||||
}
|
||||
|
||||
func (m *Page) GetPageIndex() int {
|
||||
if m.PageIndex <= 0 {
|
||||
m.PageIndex = 1
|
||||
}
|
||||
return m.PageIndex
|
||||
}
|
||||
|
||||
func (m *Page) GetPageSize() int {
|
||||
if m.PageSize <= 0 {
|
||||
m.PageSize = 10
|
||||
}
|
||||
return m.PageSize
|
||||
}
|
||||
42
form/peak_valley_rule.go
Normal file
42
form/peak_valley_rule.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package form
|
||||
|
||||
// 一天的完整谷峰规则
|
||||
// 发电 (光伏)
|
||||
// 用电 (电机、生产)
|
||||
|
||||
//新建规则
|
||||
//
|
||||
//选择时间段 设置电价
|
||||
//(将时间段 转化为十分钟区块 查找到对应十分钟区块 创建该规则的电价)
|
||||
|
||||
type PeakValleyRuleListReq struct {
|
||||
Page `json:"page"`
|
||||
}
|
||||
|
||||
type PeakValleyRuleDetailReq struct {
|
||||
RuleId int `form:"rule_id" json:"rule_id"`
|
||||
}
|
||||
|
||||
type PeakValleyRuleEditDetailReq struct {
|
||||
RuleId int `form:"rule_id" json:"rule_id"`
|
||||
}
|
||||
|
||||
type CreatePeakValleyRuleReq struct {
|
||||
RuleName string `json:"rule_name" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
RuleItem []TimeBlockPriceReq `json:"rule_item"`
|
||||
}
|
||||
type UpdatePeakValleyRuleReq struct {
|
||||
RuleId int `json:"rule_id" binding:"required"`
|
||||
RuleName string `json:"rule_name" binding:"required"`
|
||||
Description string `json:"description" binding:"required"`
|
||||
RuleItem []TimeBlockPriceReq `json:"rule_item"`
|
||||
}
|
||||
|
||||
type TimeBlockPriceReq struct {
|
||||
CustomName string `json:"custom_name"`
|
||||
PeakValleyType uint `json:"peak_valley_type"`
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time"`
|
||||
Price int `json:"price"`
|
||||
}
|
||||
Reference in New Issue
Block a user