types.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. package datacenter_client
  2. type (
  3. // 公共部分
  4. ItemHistoryResp struct {
  5. ProjectId int `json:"project_id"`
  6. ItemName string `json:"item_name"`
  7. Val float64 `json:"val"`
  8. HTime string `json:"h_time"`
  9. }
  10. InstrumentCompareData struct {
  11. Max float64 `json:"max_val"`
  12. Min float64 `json:"min_val"`
  13. }
  14. WorkingPump struct {
  15. Id int64
  16. ProjectId int64
  17. DeviceCode string
  18. FeedPressure float64
  19. OutPressure float64
  20. Duration int64
  21. Current float64
  22. Frequency float64
  23. Lift float64
  24. Efficiency float64
  25. RunStatus int64
  26. FaultStatus int64
  27. CTime string
  28. }
  29. WorkingChest struct {
  30. Id int64
  31. ProjectId int64
  32. DeviceCode string
  33. Switch int64
  34. Level float64
  35. AgitatorStatus int64
  36. AgitatorDuration int64
  37. AgitatorFaultStatus int64
  38. CTime string
  39. }
  40. WorkingRo struct {
  41. Id int64
  42. ProjectId int64
  43. DeviceCode string
  44. WaterTemperature float64
  45. FeedFlow_1St float64
  46. ConFlow_1St float64
  47. ProductFlow_1St float64
  48. FeedPressure_1St float64
  49. ConPressure_1St float64
  50. ProductPressure_1St float64
  51. Tmp_1St float64
  52. Flux_1St float64
  53. Permeability_1St float64
  54. FeedFlow_2Nd float64
  55. ConFlow_2Nd float64
  56. ProductFlow_2Nd float64
  57. FeedPressure_2Nd float64
  58. ConPressure_2Nd float64
  59. ProductPressure_2Nd float64
  60. Tmp_2Nd float64
  61. Flux_2Nd float64
  62. Permeability_2Nd float64
  63. FeedFlow_3Th float64
  64. ConFlow_3Th float64
  65. ProductFlow_3Th float64
  66. FeedPressure_3Th float64
  67. ConPressure_3Th float64
  68. ProductPressure_3Th float64
  69. Tmp_3Th float64
  70. Flux_3Th float64
  71. Permeability_3Th float64
  72. FeedWqTurbidity float64
  73. FeedWqPh int64
  74. ProductWqPh int64
  75. FeedWqAl float64
  76. ProductWqAl float64
  77. FeedWqFe float64
  78. ProductWqFe float64
  79. FeedWqMn float64
  80. ProductWqMn float64
  81. FeedWqSio2 float64
  82. ProductWqSio2 float64
  83. FeedWqCod float64
  84. ProductWqCod float64
  85. FeedWqP float64
  86. ProductWqP float64
  87. Step int64
  88. CTime string
  89. }
  90. WorkingUf struct {
  91. Id int64
  92. ProjectId int64
  93. DeviceCode string
  94. WaterTemperature float64
  95. FeedFlow float64
  96. ConFlow float64
  97. ProductFlow float64
  98. FeedPressure float64
  99. ConPressure float64
  100. ProductPressure float64
  101. Tmp float64
  102. Flux float64
  103. FeedWqTurbidity float64
  104. FeedWqPh int64
  105. ProductWqPh int64
  106. FeedWqAl float64
  107. ProductWqAl float64
  108. FeedWqFe float64
  109. ProductWqFe float64
  110. FeedWqMn float64
  111. ProductWqMn float64
  112. FeedWqSio2 float64
  113. ProductWqSio2 float64
  114. FeedWqCod float64
  115. ProductWqCod float64
  116. FeedWqP float64
  117. ProductWqP float64
  118. Step int64
  119. FilterTime float64
  120. FilterCycle int64
  121. CTime string
  122. }
  123. )
  124. type (
  125. // 请求参数部分
  126. FindWorkingUfByCycleReq struct {
  127. ProjectId int64
  128. DeviceCode string
  129. FilterCycle int64
  130. Step int64
  131. FilterTimeStart float64
  132. FilterTimeEnd float64
  133. Limit int64
  134. }
  135. DcWorkingReq struct {
  136. ProjectId int64
  137. DeviceCode string
  138. Stime string
  139. Etime string
  140. Page int64
  141. PageSize int64
  142. Order string
  143. }
  144. // 点位最大 and 最小值请求
  145. RangeMaxMinReq struct {
  146. ProjectId string
  147. ItemName string
  148. Stime string
  149. Etime string
  150. }
  151. ItemHistoryReq struct {
  152. ProjectId string
  153. ItemName string
  154. Stime string
  155. Etime string
  156. }
  157. // 点位数据写入结构
  158. ItemHistoryData struct {
  159. ProjectId int `json:"project_id"`
  160. ItemName string `json:"item_name"`
  161. Val float64 `json:"val"`
  162. HTime string `json:"h_time"`
  163. }
  164. // 点位数据写入请求
  165. MultiAddReq struct {
  166. List []ItemHistoryData `json:"list"`
  167. }
  168. )
  169. type (
  170. // 响应结构部分
  171. GetWorkingPumpByCodeResp struct {
  172. Code int `json:"code"`
  173. Msg string `json:"msg"`
  174. Data struct {
  175. List []WorkingPump `json:"list"`
  176. } `json:"data"`
  177. }
  178. GetWorkingChestByCodeResp struct {
  179. Code int `json:"code"`
  180. Msg string `json:"msg"`
  181. Data struct {
  182. List []WorkingChest `json:"list"`
  183. } `json:"data"`
  184. }
  185. GetWorkingRoByCodeResp struct {
  186. Code int `json:"code"`
  187. Msg string `json:"msg"`
  188. Data struct {
  189. List []WorkingRo `json:"list"`
  190. } `json:"data"`
  191. }
  192. FindWorkingUfByCycleResp struct {
  193. Code int `json:"code"`
  194. Msg string `json:"msg"`
  195. Data struct {
  196. List []WorkingUf `json:"list"`
  197. } `json:"data"`
  198. }
  199. GetWorkingUfByCodeResp struct {
  200. Code int `json:"code"`
  201. Msg string `json:"msg"`
  202. Data struct {
  203. List []WorkingUf `json:"list"`
  204. } `json:"data"`
  205. }
  206. RangeMaxMinResp struct {
  207. Code int `json:"code"`
  208. Msg string `json:"msg"`
  209. Data *InstrumentCompareData `json:"data"`
  210. }
  211. ItemHistoryRespList struct {
  212. List []ItemHistoryResp
  213. }
  214. MultiAddBody struct {
  215. Code int `json:"code"`
  216. Msg string `json:"msg"`
  217. }
  218. ItemHistoryBody struct {
  219. Code int `json:"code"`
  220. Msg string `json:"msg"`
  221. Data ItemHistoryRespList `json:"data"`
  222. }
  223. )
  224. type (
  225. // DcAPI 在这里定义了数据中心接口, 具体实现在版本目录中(目前只有v1)
  226. DcAPI interface {
  227. // GetItemHistory 查询历史点位数据
  228. GetItemHistory(req ItemHistoryReq) (resp []ItemHistoryResp, err error)
  229. // MultiAddData 点位数据写入
  230. MultiAddData(req MultiAddReq) (err error)
  231. // ObtainRangeMaxMin 查询最大最小值
  232. ObtainRangeMaxMin(req *RangeMaxMinReq) (resp *InstrumentCompareData, err error)
  233. // GetWorkingUfByCode 获得uf工况数据
  234. GetWorkingUfByCode(DcWorkingReq) (*GetWorkingUfByCodeResp, error)
  235. // FindWorkingUfByCycle 查询uf工况数据, 按周期进行过滤
  236. FindWorkingUfByCycle(FindWorkingUfByCycleReq) (*FindWorkingUfByCycleResp, error)
  237. // GetWorkingRoByCode 查询ro工况数据
  238. GetWorkingRoByCode(DcWorkingReq) (*GetWorkingRoByCodeResp, error)
  239. // GetWorkingChestByCode 查询液体容器类工况数据
  240. GetWorkingChestByCode(DcWorkingReq) (*GetWorkingChestByCodeResp, error)
  241. // GetWorkingPumpByCode 查询泵类工况数据
  242. GetWorkingPumpByCode(DcWorkingReq) (*GetWorkingPumpByCodeResp, error)
  243. }
  244. )