package domain import ( "go.mongodb.org/mongo-driver/bson/primitive" ) type BatchDownloadInfo struct { Id primitive.ObjectID `bson:"_id" json:"id"` Sn []string `bson:"sn" json:"sn"` Description string `bson:"description" json:"description"` TimePeriod [2]string `bson:"timePeriod" json:"timePeriod"` Options BatchDownloadOptions `bson:"options"` Progress Progress `bson:"progress" json:"progress"` FailReasons []string `bson:"failReasons" json:"failReasons"` } type BatchDownloadOptions struct { PowerFlow bool `bson:"powerFlow" json:"powerFlow"` // 功率流图 MqttLogs []string `bson:"mqttLogs" json:"mqttLogs"` // MQTT日志 EventAlarm bool `bson:"eventAlarm" json:"eventAlarm"` // 事件和告警日志 AlarmSnapshot bool `bson:"alarmSnapshot" json:"alarmSnapshot"` // 告警快照 EmsLogs []string `bson:"emsLogs" json:"emsLogs"` // EMS日志 FaultRecord bool `bson:"faultRecord" json:"faultRecord"` // 故障录波 UpdateLog bool `bson:"updateLog" json:"updateLog"` // 升级记录 Settings bool `bson:"settings" json:"settings"` // 站点设置 } type BatchDownloadConfigWrite struct { Sn []string `bson:"sn" json:"sn"` Description string `bson:"description" json:"description"` TimePeriod [2]string `bson:"timePeriod" json:"timePeriod"` Options BatchDownloadOptions `bson:"options"` } type BatchDownloadConfig struct { Id primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Sn []string `bson:"sn" json:"sn"` Description string `bson:"description" json:"description"` TimePeriod [2]string `bson:"timePeriod" json:"timePeriod"` Options BatchDownloadOptions `bson:"options"` Progress Progress `bson:"progress" json:"progress"` Data map[string]BatchDownloadData `bson:"data" json:"data"` // map-key为SN FailReasons []string `bson:"failReasons" json:"failReasons"` } type TaskBatchDownload struct { Id primitive.ObjectID `bson:"_id" json:"id"` Sn []string `bson:"sn" json:"sn"` TimePeriod [2]string `bson:"timePeriod" json:"timePeriod"` Options BatchDownloadOptions `bson:"options"` } // 数据说明 // map的key为日期,格式为 YYYY-MM-DD // MqttLogs和EmsLogs的二级map为日志类型名称 // 存储的最终数据是文件服务器(minio)的存储路径 type BatchDownloadData struct { PowerFlow map[string]string `bson:"powerFlow" json:"powerFlow"` // 功率流图 MqttLogs map[string]map[string]string `bson:"mqttLogs" json:"mqttLogs"` // MQTT日志 EventAlarm map[string]string `bson:"eventAlarm" json:"eventAlarm"` // 事件和告警日志 AlarmSnapshot map[string]string `bson:"alarmSnapshot" json:"alarmSnapshot"` // 告警快照 EmsLogs map[string]map[string]string `bson:"emsLogs" json:"emsLogs"` // EMS日志 FaultRecord map[string]string `bson:"faultRecord" json:"faultRecord"` // 故障录波 map的key为文件名 UpdateLog string `bson:"updateLog" json:"updateLog"` // 升级记录 Settings string `bson:"settings" json:"settings"` // 站点设置 } // 下载任务数据 (保存于redis数据库) type BatchDownloadFileTaskInfo struct { DevType int `bson:"devType" json:"devType"` // 设备类型:-1-忽略 0-aPower 1-aGate 2-MPPT 3-aHub Sn string `bson:"sn" json:"sn"` Date string `bson:"date" json:"date"` FileType string `bson:"fileType" json:"fileType"` FileSupType string `bson:"fileSubType" json:"fileSubType"` Result int `bson:"result" json:"result"` // -1-失败 0-进行中 1-成功 Reason string `bson:"reason" json:"reason"` // 失败原因 } type BatchDownloadUpdateLogVersionInfo struct { Name string `json:"name"` // 名称 OldVer string `json:"oldVer"` NewVer string `json:"newVer"` } type BatchDownloadUpdateLogSubDevInfo struct { DevSn string `json:"devSn"` DevVerList []BatchDownloadUpdateLogVersionInfo `json:"devVerList"` } type BatchDownloadUpdateLogAHubVersionInfo struct { FileName string `json:"fileName"` // 文件名称 FileOrder string `json:"fileOrder"` // 文件单号 Result string `json:"result"` // 升级结果 "0"-成功 ResultDesc string `json:"resultDesc"` // 升级结果说明 OldVer string `json:"oldVer"` NewVer string `json:"newVer"` } // 系统升级日志信息数据 type BatchDownloadSystemUpdateLogInfo struct { OrderNo string `json:"orderNo"` // 升级工单号 TriggerType string `json:"triggerType"` // 触发类型 自动 or 手动 GateSn string `json:"gateSn"` FileName string `json:"fileName"` // 升级包名 UpdateTime string `json:"updateTime"` // 触发升级时间 - 北京时间 Result string `json:"result"` // 升级结果 GateVerList []BatchDownloadUpdateLogVersionInfo `json:"gateVerList"` SubDevList []BatchDownloadUpdateLogSubDevInfo `json:"subVerList"` } // aHub升级日志信息数据 type BatchDownloadAHubUpdateLogInfo struct { OrderNo string `json:"orderNo"` // 升级工单号 TriggerType string `json:"triggerType"` // 触发类型 自动 or 手动 AHubSn string `json:"aHubSn"` // aHubSn GateSn string `json:"gateSn"` EndTime string `json:"endTime"` // 升级时间 - 北京时间 Result string `json:"result"` // 升级结果 DetailList []BatchDownloadUpdateLogAHubVersionInfo `json:"detailList"` }