123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- 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"`
- }
- )
- 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
- }
- MultiAddBody struct {
- Code int `json:"code"`
- Msg string `json:"msg"`
- }
- ItemHistoryBody struct {
- Code int `json:"code"`
- Msg string `json:"msg"`
- Data ItemHistoryRespList `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)
- }
- )
|