123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- 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"`
- }
- RangeFirstLast struct {
- First float64 `json:"first"`
- Last float64 `json:"last"`
- }
- WorkingPump struct {
- Id int64 `json:"id"`
- ProjectId int64 `json:"project_id"`
- DeviceCode string `json:"device_code"`
- FeedPressure float64 `json:"feed_pressure"`
- OutPressure float64 `json:"out_pressure"`
- Duration int64 `json:"duration"`
- Current float64 `json:"current"`
- Frequency float64 `json:"frequency"`
- Lift float64 `json:"lift"`
- Efficiency float64 `json:"efficiency"`
- RunStatus int64 `json:"run_status"`
- FaultStatus int64 `json:"fault_status"`
- CTime string `json:"c_time"`
- }
- WorkingChest struct {
- Id int64 `json:"id"`
- ProjectId int64 `json:"project_id"`
- DeviceCode string `json:"device_code"`
- Switch int64 `json:"switch"`
- Level float64 `json:"level"`
- AgitatorStatus int64 `json:"agitator_status"`
- AgitatorDuration int64 `json:"agitator_duration"`
- AgitatorFaultStatus int64 `json:"agitator_fault_status"`
- CTime string `json:"c_time"`
- }
- WorkingRo struct {
- Id int64 `json:"id"`
- ProjectId int64 `json:"project_id"`
- DeviceCode string `json:"device_code"`
- WaterTemperature float64 `json:"water_temperature"`
- FeedFlow_1St float64 `json:"feed_flow_1_st"`
- ConFlow_1St float64 `json:"con_flow_1_st"`
- ProductFlow_1St float64 `json:"product_flow_1_st"`
- FeedPressure_1St float64 `json:"feed_pressure_1_st"`
- ConPressure_1St float64 `json:"con_pressure_1_st"`
- ProductPressure_1St float64 `json:"product_pressure_1_st"`
- Tmp_1St float64 `json:"tmp_1_st"`
- Flux_1St float64 `json:"flux_1_st"`
- Permeability_1St float64 `json:"permeability_1_st"`
- FeedFlow_2Nd float64 `json:"feed_flow_2_nd"`
- ConFlow_2Nd float64 `json:"con_flow_2_nd"`
- ProductFlow_2Nd float64 `json:"product_flow_2_nd"`
- FeedPressure_2Nd float64 `json:"feed_pressure_2_nd"`
- ConPressure_2Nd float64 `json:"con_pressure_2_nd"`
- ProductPressure_2Nd float64 `json:"product_pressure_2_nd"`
- Tmp_2Nd float64 `json:"tmp_2_nd"`
- Flux_2Nd float64 `json:"flux_2_nd"`
- Permeability_2Nd float64 `json:"permeability_2_nd"`
- FeedFlow_3Th float64 `json:"feed_flow_3_th"`
- ConFlow_3Th float64 `json:"con_flow_3_th"`
- ProductFlow_3Th float64 `json:"product_flow_3_th"`
- FeedPressure_3Th float64 `json:"feed_pressure_3_th"`
- ConPressure_3Th float64 `json:"con_pressure_3_th"`
- ProductPressure_3Th float64 `json:"product_pressure_3_th"`
- Tmp_3Th float64 `json:"tmp_3_th"`
- Flux_3Th float64 `json:"flux_3_th"`
- Permeability_3Th float64 `json:"permeability_3_th"`
- FeedWqTurbidity float64 `json:"feed_wq_turbidity"`
- FeedWqPh int64 `json:"feed_wq_ph"`
- ProductWqPh int64 `json:"product_wq_ph"`
- FeedWqAl float64 `json:"feed_wq_al"`
- ProductWqAl float64 `json:"product_wq_al"`
- FeedWqFe float64 `json:"feed_wq_fe"`
- ProductWqFe float64 `json:"product_wq_fe"`
- FeedWqMn float64 `json:"feed_wq_mn"`
- ProductWqMn float64 `json:"product_wq_mn"`
- FeedWqSio2 float64 `json:"feed_wq_sio_2"`
- ProductWqSio2 float64 `json:"product_wq_sio_2"`
- FeedWqCod float64 `json:"feed_wq_cod"`
- ProductWqCod float64 `json:"product_wq_cod"`
- FeedWqP float64 `json:"feed_wq_p"`
- ProductWqP float64 `json:"product_wq_p"`
- Step int64 `json:"step"`
- CTime string `json:"c_time"`
- }
- WorkingUf struct {
- Id int64 `json:"id"`
- ProjectId int64 `json:"project_id"`
- DeviceCode string `json:"device_code"`
- WaterTemperature float64 `json:"water_temperature"`
- FeedFlow float64 `json:"feed_flow"`
- ConFlow float64 `json:"con_flow"`
- ProductFlow float64 `json:"product_flow"`
- FeedPressure float64 `json:"feed_pressure"`
- ConPressure float64 `json:"con_pressure"`
- ProductPressure float64 `json:"product_pressure"`
- Tmp float64 `json:"tmp"`
- Flux float64 `json:"flux"`
- Permeability float64 `json:"permeability"`
- FeedWqTurbidity float64 `json:"feed_wq_turbidity"`
- FeedWqPh int64 `json:"feed_wq_ph"`
- ProductWqPh int64 `json:"product_wq_ph"`
- FeedWqAl float64 `json:"feed_wq_al"`
- ProductWqAl float64 `json:"product_wq_al"`
- FeedWqFe float64 `json:"feed_wq_fe"`
- ProductWqFe float64 `json:"product_wq_fe"`
- FeedWqMn float64 `json:"feed_wq_mn"`
- ProductWqMn float64 `json:"product_wq_mn"`
- FeedWqSio2 float64 `json:"feed_wq_sio_2"`
- ProductWqSio2 float64 `json:"product_wq_sio_2"`
- FeedWqCod float64 `json:"feed_wq_cod"`
- ProductWqCod float64 `json:"product_wq_cod"`
- FeedWqP float64 `json:"feed_wq_p"`
- ProductWqP float64 `json:"product_wq_p"`
- Step int64 `json:"step"`
- FilterTime float64 `json:"filter_time"`
- FilterCycle int64 `json:"filter_cycle"`
- CTime string `json:"c_time"`
- }
- )
- 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
- }
- RangeFirstLastReq 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"`
- }
- RangeFirstLastResp struct {
- Code int `json:"code"`
- Msg string `json:"msg"`
- Data *RangeFirstLast `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)
- }
- )
|