You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.3 KiB

package common_models
4 weeks ago
import (
"encoding/json"
"time"
)
// EsGroupTheme 分组主题数据结构体
type EsGroupTheme struct {
StructId int `json:"struct_id"`
GroupId int `json:"group_id"`
GroupName string `json:"group_name"`
GroupType string `json:"group_type"`
TaskId string `json:"task_id"`
CorrItems []StationGroupInfo `json:"corr_items"`
Data []CorrItemData `json:"data"`
CollectTime time.Time `json:"collect_time"`
CreateTime time.Time `json:"create_time"`
}
4 weeks ago
func (the EsGroupTheme) MarshalJSON() ([]byte, error) {
type Alias EsGroupTheme
return json.Marshal(&struct {
CollectTime string `json:"collect_time"`
CreateTime string `json:"create_time"`
*Alias
}{
CollectTime: the.CollectTime.Format("2006-01-02T15:04:05.000+08:00"),
CreateTime: the.CreateTime.Format("2006-01-02T15:04:05.000+08:00"),
Alias: (*Alias)(&the),
})
}
// 级联测点数据
type CorrItemData struct {
StationId int `json:"station_id"`
StationName string `json:"station_name"`
IsBase *bool `json:"is_base,omitempty"`
PhyData map[string]interface{} `json:"phy_data"`
ThemeData map[string]interface{} `json:"theme_data"`
}