package dto import ( "time" faultRecordFile "fwh-toolbox-server/function/FaultRecordFile" proto "fwh-toolbox-server/function/FaultRecordProtocol" ) // FaultRecordCreateOpReq 创建故障录波操作 type FaultRecordCreateOpReq struct { Env string `json:"env"` // prod / test GatewaySn string `json:"gatewaySn"` // aGate SN DeviceType string `json:"deviceType"` // aGate / pe DeviceSn string `json:"deviceSn"` // aGate 时可为空,默认网关 SN Kind string `json:"kind"` // device_info / record_fetch / param_read / param_write CodeList []int `json:"codeList,omitempty"` RecordIndex int `json:"recordIndex,omitempty"` // 单条(兼容) RecordIndexes []int `json:"recordIndexes,omitempty"` // 多条,设备打成一个包 IdList []int `json:"idList,omitempty"` ParaList []proto.ParaItem `json:"paraList,omitempty"` } // FaultRecordDevice 可操作的设备 type FaultRecordDevice struct { Kind string `json:"kind"` // aGate / aPowerPE / aPowerMPPT / aHub Type string `json:"type"` // 377 报文中的 type(aGate / pe);为空表示协议类型待确认 Sn string `json:"sn"` // aPower-MPPT 与 aPower-PE 使用同一 SN Model string `json:"model,omitempty"` // 型号,如 aPower S HwVer *int `json:"hwVer,omitempty"` // aPower PE 硬件版本 Supported bool `json:"supported"` // 是否可发起操作 Note string `json:"note,omitempty"` // 不可用原因 } // FaultRecordSiteDevices 网关及其设备 type FaultRecordSiteDevices struct { Env string `json:"env"` GatewaySn string `json:"gatewaySn"` SiteName string `json:"siteName"` Online bool `json:"online"` OnlineTime string `json:"onlineTime,omitempty"` Devices []FaultRecordDevice `json:"devices"` Warnings []string `json:"warnings,omitempty"` // 部分设备信息获取失败时的提示 } // FaultRecordOpSummary 操作历史列表项 type FaultRecordOpSummary struct { ID string `json:"id"` Env string `json:"env"` GatewaySn string `json:"gatewaySn"` DeviceType string `json:"deviceType"` DeviceSn string `json:"deviceSn"` Kind string `json:"kind"` Summary string `json:"summary"` // 请求参数摘要 Operator string `json:"operator"` Status string `json:"status"` TimeoutStage string `json:"timeoutStage,omitempty"` Error string `json:"error,omitempty"` StageTimes map[string]time.Time `json:"stageTimes"` FileName string `json:"fileName,omitempty"` FaultRecordID int64 `json:"faultRecordId,omitempty"` CanCancel bool `json:"canCancel"` CanRetryDownload bool `json:"canRetryDownload"` // 上传已完成但下载失败,可手动重试下载 HasFile bool `json:"hasFile"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } // FaultRecordOpMessageView 原始报文 type FaultRecordOpMessageView struct { Direction string `json:"direction"` Topic string `json:"topic"` CmdType uint `json:"cmdType"` At time.Time `json:"at"` Raw string `json:"raw"` } // FaultRecordResultItem 解析后的逐项结果 type FaultRecordResultItem struct { Code int `json:"code,omitempty"` // device_info:数据类别;record_fetch:数据类型码 4/5 Id int `json:"id,omitempty"` // param_read / param_write:功能码 Name string `json:"name"` // 名称 SetVal string `json:"setVal,omitempty"` // param_write:设置值 Raw string `json:"raw,omitempty"` // hexData / idData 原文 Decoded any `json:"decoded,omitempty"` DecodeErr string `json:"decodeError,omitempty"` ResultOne string `json:"resultOne"` ResultDesc string `json:"resultDesc"` Ok bool `json:"ok"` } // FaultRecordOpDetail 操作详情 type FaultRecordOpDetail struct { FaultRecordOpSummary Request any `json:"request"` ReplyResult string `json:"replyResult,omitempty"` ReplyDesc string `json:"replyDesc,omitempty"` Items []FaultRecordResultItem `json:"items"` Messages []FaultRecordOpMessageView `json:"messages"` } // FaultRecordRecordView 录波详情(record_fetch 完成后) type FaultRecordRecordView struct { OperationID string `json:"operationId"` Records []faultRecordFile.Record `json:"records"` }