package datacenter_client type ( // 公共部分 ItemHistoryResp struct { ProjectId int `json:"project_id"` ItemName string `json:"item_name"` Val float64 `json:"val"` HTime string `json:"h_time"` } InstrumentCompareData struct { Max float64 `json:"max_val"` Min float64 `json:"min_val"` } WorkingPump struct { Id int64 ProjectId int64 DeviceCode string FeedPressure float64 OutPressure float64 Duration int64 Current float64 Frequency float64 Lift float64 Efficiency float64 RunStatus int64 FaultStatus int64 CTime string } WorkingChest struct { Id int64 ProjectId int64 DeviceCode string Switch int64 Level float64 AgitatorStatus int64 AgitatorDuration int64 AgitatorFaultStatus int64 CTime string } WorkingRo struct { Id int64 ProjectId int64 DeviceCode string WaterTemperature float64 FeedFlow_1St float64 ConFlow_1St float64 ProductFlow_1St float64 FeedPressure_1St float64 ConPressure_1St float64 ProductPressure_1St float64 Tmp_1St float64 Flux_1St float64 Permeability_1St float64 FeedFlow_2Nd float64 ConFlow_2Nd float64 ProductFlow_2Nd float64 FeedPressure_2Nd float64 ConPressure_2Nd float64 ProductPressure_2Nd float64 Tmp_2Nd float64 Flux_2Nd float64 Permeability_2Nd float64 FeedFlow_3Th float64 ConFlow_3Th float64 ProductFlow_3Th float64 FeedPressure_3Th float64 ConPressure_3Th float64 ProductPressure_3Th float64 Tmp_3Th float64 Flux_3Th float64 Permeability_3Th float64 FeedWqTurbidity float64 FeedWqPh int64 ProductWqPh int64 FeedWqAl float64 ProductWqAl float64 FeedWqFe float64 ProductWqFe float64 FeedWqMn float64 ProductWqMn float64 FeedWqSio2 float64 ProductWqSio2 float64 FeedWqCod float64 ProductWqCod float64 FeedWqP float64 ProductWqP float64 Step int64 CTime string } WorkingUf struct { Id int64 ProjectId int64 DeviceCode string WaterTemperature float64 FeedFlow float64 ConFlow float64 ProductFlow float64 FeedPressure float64 ConPressure float64 ProductPressure float64 Tmp float64 Flux float64 Permeability float64 FeedWqTurbidity float64 FeedWqPh int64 ProductWqPh int64 FeedWqAl float64 ProductWqAl float64 FeedWqFe float64 ProductWqFe float64 FeedWqMn float64 ProductWqMn float64 FeedWqSio2 float64 ProductWqSio2 float64 FeedWqCod float64 ProductWqCod float64 FeedWqP float64 ProductWqP float64 Step int64 FilterTime float64 FilterCycle int64 CTime string } ) type ( // 请求参数部分 FindWorkingUfByCycleReq struct { ProjectId int64 DeviceCode string FilterCycle int64 Step int64 FilterTimeStart float64 FilterTimeEnd float64 Limit int64 } DcWorkingReq struct { ProjectId int64 DeviceCode string Stime string Etime string Page int64 PageSize int64 Order string } // 点位最大 and 最小值请求 RangeMaxMinReq struct { ProjectId string ItemName string Stime string Etime string } ItemHistoryReq struct { ProjectId string ItemName string Stime string Etime string } // 点位数据写入结构 ItemHistoryData struct { ProjectId int `json:"project_id"` ItemName string `json:"item_name"` Val float64 `json:"val"` HTime string `json:"h_time"` } // 点位数据写入请求 MultiAddReq struct { List []ItemHistoryData `json:"list"` } ItemHistoryListReq struct { ProjectId int ItemName string Stime string Etime string Size int Interval string // 时间单位 minute,h,day,s Aggregator string // 聚合方式 min,max,avg,sum,realtime, new } ) type ( // 响应结构部分 GetWorkingPumpByCodeResp struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { List []WorkingPump `json:"list"` } `json:"data"` } GetWorkingChestByCodeResp struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { List []WorkingChest `json:"list"` } `json:"data"` } GetWorkingRoByCodeResp struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { List []WorkingRo `json:"list"` } `json:"data"` } FindWorkingUfByCycleResp struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { List []WorkingUf `json:"list"` } `json:"data"` } GetWorkingUfByCodeResp struct { Code int `json:"code"` Msg string `json:"msg"` Data struct { List []WorkingUf `json:"list"` } `json:"data"` } RangeMaxMinResp struct { Code int `json:"code"` Msg string `json:"msg"` Data *InstrumentCompareData `json:"data"` } ItemHistoryRespList struct { List []ItemHistoryResp } ItemHistoryListResp struct { Name string `json:"name"` Htime string `json:"htime_at"` Val float64 `json:"val"` } ItemHistoryListRespList struct { List []ItemHistoryListResp } MultiAddBody struct { Code int `json:"code"` Msg string `json:"msg"` } ItemHistoryBody struct { Code int `json:"code"` Msg string `json:"msg"` Data ItemHistoryRespList `json:"data"` } ItemHistoryListBody struct { Code int `json:"code"` Msg string `json:"msg"` Data ItemHistoryListRespList `json:"data"` } ) type ( // DcAPI 在这里定义了数据中心接口, 具体实现在版本目录中(目前只有v1) DcAPI interface { // GetItemHistory 查询历史点位数据 GetItemHistory(req ItemHistoryReq) (resp []ItemHistoryResp, err error) // MultiAddData 点位数据写入 MultiAddData(req MultiAddReq) (err error) // ObtainRangeMaxMin 查询最大最小值 ObtainRangeMaxMin(req *RangeMaxMinReq) (resp *InstrumentCompareData, err error) // GetWorkingUfByCode 获得uf工况数据 GetWorkingUfByCode(DcWorkingReq) (*GetWorkingUfByCodeResp, error) // FindWorkingUfByCycle 查询uf工况数据, 按周期进行过滤 FindWorkingUfByCycle(FindWorkingUfByCycleReq) (*FindWorkingUfByCycleResp, error) // GetWorkingRoByCode 查询ro工况数据 GetWorkingRoByCode(DcWorkingReq) (*GetWorkingRoByCodeResp, error) // GetWorkingChestByCode 查询液体容器类工况数据 GetWorkingChestByCode(DcWorkingReq) (*GetWorkingChestByCodeResp, error) // GetWorkingPumpByCode 查询泵类工况数据 GetWorkingPumpByCode(DcWorkingReq) (*GetWorkingPumpByCodeResp, error) // 平替双胞胎图表接口(时间区间内按要求聚合) GetItemHistoryList(ItemHistoryListReq) (resp []ItemHistoryListResp, err error) } )