datacenter.proto 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. syntax = "proto3";
  2. package pb;
  3. option go_package = "./pb";
  4. message Pagination {
  5. uint32 current = 1;
  6. uint32 pageSize = 2;
  7. uint32 total = 3;
  8. }
  9. message DataDescribeInfo {
  10. // @gotags: json:"count"
  11. uint32 count = 1;
  12. // @gotags: json:"min"
  13. double min = 2;
  14. // @gotags: json:"max"
  15. double max = 3;
  16. // @gotags: json:"mean"
  17. double mean = 4;
  18. // @gotags: json:"std_dev"
  19. double std_dev = 5;
  20. // @gotags: json:"var_dev"
  21. double var_dev = 6;
  22. // @gotags: json:"p25"
  23. double p25 = 7;
  24. // @gotags: json:"p50"
  25. double p50 = 8;
  26. // @gotags: json:"p75"
  27. double p75 = 9;
  28. // @gotags: json:"st"
  29. string st = 10;
  30. // @gotags: json:"et"
  31. string et = 11;
  32. }
  33. message DataMinAndMaxInfo {
  34. // @gotags: json:"min"
  35. double min = 1;
  36. // @gotags: json:"max"
  37. double max = 2;
  38. }
  39. message RelatedItems {
  40. string item = 1;
  41. float coefficient = 2;
  42. }
  43. message DataCorrelationInfo {
  44. // @gotags: json:"related_items"
  45. map <string, RelatedItems> related_items = 1;
  46. // @gotags: json:"st"
  47. string st = 10;
  48. // @gotags: json:"et"
  49. string et = 11;
  50. }
  51. message AppInfo {
  52. int64 id = 1;
  53. string app_name = 2;
  54. repeated int64 project_ids = 3;
  55. string secret = 4;
  56. int64 status = 5;
  57. string expire_at = 6;
  58. string c_time = 7;
  59. }
  60. message DcWorkingReq{
  61. int64 project_id = 1;
  62. string device_code = 2;
  63. string stime = 3; // c_time的搜索
  64. string etime = 4; // c_time的搜索
  65. int64 page = 5;
  66. int64 page_size = 6;
  67. string order = 7; // 排序字段及方向 例: id desc
  68. }
  69. message WorkingMf{
  70. // @gotags: json:"id"
  71. int64 id = 1;
  72. // @gotags: json:"project_id"
  73. int64 project_id = 2;
  74. // @gotags: json:"device_code"
  75. string device_code = 3;
  76. // @gotags: json:"water_temperature"
  77. double water_temperature = 4; // 水温 摄氏度
  78. // @gotags: json:"feed_flow"
  79. double feed_flow = 5; // 进水流量
  80. // @gotags: json:"con_flow"
  81. double con_flow = 6; // 浓水流量
  82. // @gotags: json:"product_flow"
  83. double product_flow = 7; // 产水流量
  84. // @gotags: json:"feed_pressure"
  85. double feed_pressure = 8; // 进水压力
  86. // @gotags: json:"con_pressure"
  87. double con_pressure = 9; // 浓水压力
  88. // @gotags: json:"product_pressure"
  89. double product_pressure = 10; // 产水压力
  90. // @gotags: json:"tmp"
  91. double tmp = 11; // 跨膜压差
  92. // @gotags: json:"flux"
  93. double flux = 12; // 膜通量
  94. // @gotags: json:"feed_wq_turbidity"
  95. double feed_wq_turbidity = 13; // 进水浊度
  96. // @gotags: json:"feed_wq_ph"
  97. int64 feed_wq_ph = 14; // 进水 PH 值
  98. // @gotags: json:"product_wq_ph"
  99. int64 product_wq_ph = 15; // 产水 PH 值
  100. // @gotags: json:"feed_wq_al"
  101. double feed_wq_al = 16; // 进水水质:铝
  102. // @gotags: json:"product_wq_al"
  103. double product_wq_al = 17; // 产水水质:铝
  104. // @gotags: json:"feed_wq_fe"
  105. double feed_wq_fe = 18; // 进水水质:铁
  106. // @gotags: json:"product_wq_fe"
  107. double product_wq_fe = 19; // 产水水质:铁
  108. // @gotags: json:"feed_wq_mn"
  109. double feed_wq_mn = 20; // 进水水质:锰
  110. // @gotags: json:"product_wq_mn"
  111. double product_wq_mn = 21; // 产水水质:锰
  112. // @gotags: json:"feed_wq_sio2"
  113. double feed_wq_sio2 = 22; // 进水水质:二氧化硅
  114. // @gotags: json:"product_wq_sio2"
  115. double product_wq_sio2 = 23; // 产水水质:二氧化硅
  116. // @gotags: json:"feed_wq_cod"
  117. double feed_wq_cod = 24; // 进水水质:COD
  118. // @gotags: json:"product_wq_cod"
  119. double product_wq_cod = 25; // 产水水质:COD
  120. // @gotags: json:"feed_wq_p"
  121. double feed_wq_p = 26; // 进水水质:磷
  122. // @gotags: json:"product_wq_p"
  123. double product_wq_p = 27; // 产水水质:磷
  124. // @gotags: json:"step"
  125. int64 step = 28; // 设备当前步序值
  126. // @gotags: json:"c_time"
  127. string c_time = 29;
  128. }
  129. message WorkingUf{
  130. // @gotags: json:"id"
  131. int64 id = 1;
  132. // @gotags: json:"project_id"
  133. int64 project_id = 2;
  134. // @gotags: json:"device_code"
  135. string device_code = 3;
  136. // @gotags: json:"water_temperature"
  137. double water_temperature = 4; // 水温 摄氏度
  138. // @gotags: json:"feed_flow"
  139. double feed_flow = 5; // 进水流量
  140. // @gotags: json:"con_flow"
  141. double con_flow = 6; // 浓水流量
  142. // @gotags: json:"product_flow"
  143. double product_flow = 7; // 产水流量
  144. // @gotags: json:"feed_pressure"
  145. double feed_pressure = 8; // 进水压力
  146. // @gotags: json:"con_pressure"
  147. double con_pressure = 9; // 浓水压力
  148. // @gotags: json:"product_pressure"
  149. double product_pressure = 10; // 产水压力
  150. // @gotags: json:"tmp"
  151. double tmp = 11; // 跨膜压差
  152. // @gotags: json:"flux"
  153. double flux = 12; // 膜通量
  154. // @gotags: json:"permeability"
  155. double permeability = 32; // 渗透率
  156. // @gotags: json:"feed_wq_turbidity"
  157. double feed_wq_turbidity = 13; // 进水浊度
  158. // @gotags: json:"feed_wq_ph"
  159. int64 feed_wq_ph = 14; // 进水 PH 值
  160. // @gotags: json:"product_wq_ph"
  161. int64 product_wq_ph = 15; // 产水 PH 值
  162. // @gotags: json:"feed_wq_al"
  163. double feed_wq_al = 16; // 进水水质:铝
  164. // @gotags: json:"product_wq_al"
  165. double product_wq_al = 17; // 产水水质:铝
  166. // @gotags: json:"feed_wq_fe"
  167. double feed_wq_fe = 18; // 进水水质:铁
  168. // @gotags: json:"product_wq_fe"
  169. double product_wq_fe = 19; // 产水水质:铁
  170. // @gotags: json:"feed_wq_mn"
  171. double feed_wq_mn = 20; // 进水水质:锰
  172. // @gotags: json:"product_wq_mn"
  173. double product_wq_mn = 21; // 产水水质:锰
  174. // @gotags: json:"feed_wq_sio2"
  175. double feed_wq_sio2 = 22; // 进水水质:二氧化硅
  176. // @gotags: json:"product_wq_sio2"
  177. double product_wq_sio2 = 23; // 产水水质:二氧化硅
  178. // @gotags: json:"feed_wq_cod"
  179. double feed_wq_cod = 24; // 进水水质:COD
  180. // @gotags: json:"product_wq_cod"
  181. double product_wq_cod = 25; // 产水水质:COD
  182. // @gotags: json:"feed_wq_p"
  183. double feed_wq_p = 26; // 进水水质:磷
  184. // @gotags: json:"product_wq_p"
  185. double product_wq_p = 27; // 产水水质:磷
  186. // @gotags: json:"step"
  187. int64 step = 28; // 设备当前步序值
  188. // @gotags: json:"filter_time"
  189. double filter_time = 29;
  190. // @gotags: json:"filter_cycle"
  191. int64 filter_cycle = 30;
  192. // @gotags: json:"c_time"
  193. string c_time = 31;
  194. }
  195. message WorkingNf{
  196. // gotags: json:"id"
  197. int64 id = 1;
  198. // gotags: json:"project_id"
  199. int64 project_id = 2;
  200. // gotags: json:"device_code"
  201. string device_code = 3;
  202. // gotags: json:"water_temperature"
  203. double water_temperature = 4; // 水温 摄氏度
  204. // gotags: json:"feed_flow_1st"
  205. double feed_flow_1st = 5; // 一段进水流量
  206. // gotags: json:"con_flow_1st"
  207. double con_flow_1st = 6; // 一段浓水流量
  208. // gotags: json:"product_flow_1st"
  209. double product_flow_1st = 7; // 一段产水流量
  210. // gotags: json:"feed_pressure_1st"
  211. double feed_pressure_1st = 8; // 一段进水压力
  212. // gotags: json:"con_pressure_1st"
  213. double con_pressure_1st = 9; // 一段浓水压力
  214. // gotags: json:"product_pressure_1st"
  215. double product_pressure_1st = 10; // 一段产水压力
  216. // gotags: json:"tmp_1st"
  217. double tmp_1st = 11; // 一段跨膜压差
  218. // gotags: json:"flux_1st"
  219. double flux_1st = 12; // 一段膜通量
  220. // gotags: json:"permeability_1st"
  221. double permeability_1st = 13; // 一段渗透率
  222. // gotags: json:"feed_flow_2nd"
  223. double feed_flow_2nd = 14; // 二段进水流量
  224. // gotags: json:"con_flow_2nd"
  225. double con_flow_2nd = 15; // 二段浓水流量
  226. // gotags: json:"product_flow_2nd"
  227. double product_flow_2nd = 16; // 二段产水流量
  228. // gotags: json:"feed_pressure_2nd"
  229. double feed_pressure_2nd = 17; // 二段进水压力
  230. // gotags: json:"con_pressure_2nd"
  231. double con_pressure_2nd = 18; // 二段浓水压力
  232. // gotags: json:"product_pressure_2nd"
  233. double product_pressure_2nd = 19; // 二段产水压力
  234. // gotags: json:"tmp_2nd"
  235. double tmp_2nd = 20; // 二段压差
  236. // gotags: json:"flux_2nd"
  237. double flux_2nd = 21; // 二段通量
  238. // gotags: json:"permeability_2nd"
  239. double permeability_2nd = 22; // 二段渗透率
  240. // gotags: json:"feed_flow_3th"
  241. double feed_flow_3th = 23; // 三段进水流量
  242. // gotags: json:"con_flow_3th"
  243. double con_flow_3th = 24; // 三段浓水流量
  244. // gotags: json:"product_flow_3th"
  245. double product_flow_3th = 25; // 三段产水流量
  246. // gotags: json:"feed_pressure_3th"
  247. double feed_pressure_3th = 26; // 三段进水压力
  248. // gotags: json:"con_pressure_3th"
  249. double con_pressure_3th = 27; // 三段浓水压力
  250. // gotags: json:"product_pressure_3th"
  251. double product_pressure_3th = 28; // 三段产水压力
  252. // gotags: json:"tmp_3th"
  253. double tmp_3th = 29; // 三段压差
  254. // gotags: json:"flux_3th"
  255. double flux_3th = 30; // 三段通量
  256. // gotags: json:"permeability_3th"
  257. double permeability_3th = 31; // 三段渗透率
  258. // gotags: json:"feed_wq_turbidity"
  259. double feed_wq_turbidity = 32; // 进水浊度
  260. // gotags: json:"feed_wq_ph"
  261. int64 feed_wq_ph = 33; // 进水 PH 值
  262. // gotags: json:"product_wq_ph"
  263. int64 product_wq_ph = 34; // 产水 PH 值
  264. // gotags: json:"feed_wq_al"
  265. double feed_wq_al = 35; // 进水水质:铝
  266. // gotags: json:"product_wq_al"
  267. double product_wq_al = 36; // 产水水质:铝
  268. // gotags: json:"feed_wq_fe"
  269. double feed_wq_fe = 37; // 进水水质:铁
  270. // gotags: json:"product_wq_fe"
  271. double product_wq_fe = 38; // 产水水质:铁
  272. // gotags: json:"feed_wq_mn"
  273. double feed_wq_mn = 39; // 进水水质:锰
  274. // gotags: json:"product_wq_mn"
  275. double product_wq_mn = 40; // 产水水质:锰
  276. // gotags: json:"feed_wq_sio2"
  277. double feed_wq_sio2 = 41; // 进水水质:二氧化硅
  278. // gotags: json:"product_wq_sio2"
  279. double product_wq_sio2 = 42; // 产水水质:二氧化硅
  280. // gotags: json:"feed_wq_cod"
  281. double feed_wq_cod = 43; // 进水水质:COD
  282. // gotags: json:"product_wq_cod"
  283. double product_wq_cod = 44; // 产水水质:COD
  284. // gotags: json:"feed_wq_p"
  285. double feed_wq_p = 45; // 进水水质:磷
  286. // gotags: json:"product_wq_p"
  287. double product_wq_p = 46; // 产水水质:磷
  288. // gotags: json:"step"
  289. int64 step = 47; // 设备当前步序值
  290. // gotags: json:"c_time"
  291. string c_time = 48;
  292. }
  293. message WorkingRo{
  294. // gotags: json:"id"
  295. int64 id = 1;
  296. // gotags: json:"project_id"
  297. int64 project_id = 2;
  298. // gotags: json:"device_code"
  299. string device_code = 3;
  300. // gotags: json:"water_temperature"
  301. double water_temperature = 4; // 水温 摄氏度
  302. // gotags: json:"feed_flow_1st"
  303. double feed_flow_1st = 5; // 一段进水流量
  304. // gotags: json:"con_flow_1st"
  305. double con_flow_1st = 6; // 一段浓水流量
  306. // gotags: json:"product_flow_1st"
  307. double product_flow_1st = 7; // 一段产水流量
  308. // gotags: json:"feed_pressure_1st"
  309. double feed_pressure_1st = 8; // 一段进水压力
  310. // gotags: json:"con_pressure_1st"
  311. double con_pressure_1st = 9; // 一段浓水压力
  312. // gotags: json:"product_pressure_1st"
  313. double product_pressure_1st = 10; // 一段产水压力
  314. // gotags: json:"tmp_1st"
  315. double tmp_1st = 11; // 一段跨膜压差
  316. // gotags: json:"flux_1st"
  317. double flux_1st = 12; // 一段膜通量
  318. // gotags: json:"permeability_1st"
  319. double permeability_1st = 13; // 一段渗透率
  320. // gotags: json:"feed_flow_2nd"
  321. double feed_flow_2nd = 14; // 二段进水流量
  322. // gotags: json:"con_flow_2nd"
  323. double con_flow_2nd = 15; // 二段浓水流量
  324. // gotags: json:"product_flow_2nd"
  325. double product_flow_2nd = 16; // 二段产水流量
  326. // gotags: json:"feed_pressure_2nd"
  327. double feed_pressure_2nd = 17; // 二段进水压力
  328. // gotags: json:"con_pressure_2nd"
  329. double con_pressure_2nd = 18; // 二段浓水压力
  330. // gotags: json:"product_pressure_2nd"
  331. double product_pressure_2nd = 19; // 二段产水压力
  332. // gotags: json:"tmp_2nd"
  333. double tmp_2nd = 20; // 二段压差
  334. // gotags: json:"flux_2nd"
  335. double flux_2nd = 21; // 二段通量
  336. // gotags: json:"permeability_2nd"
  337. double permeability_2nd = 22; // 二段渗透率
  338. // gotags: json:"feed_flow_3th"
  339. double feed_flow_3th = 23; // 三段进水流量
  340. // gotags: json:"con_flow_3th"
  341. double con_flow_3th = 24; // 三段浓水流量
  342. // gotags: json:"product_flow_3th"
  343. double product_flow_3th = 25; // 三段产水流量
  344. // gotags: json:"feed_pressure_3th"
  345. double feed_pressure_3th = 26; // 三段进水压力
  346. // gotags: json:"con_pressure_3th"
  347. double con_pressure_3th = 27; // 三段浓水压力
  348. // gotags: json:"product_pressure_3th"
  349. double product_pressure_3th = 28; // 三段产水压力
  350. // gotags: json:"tmp_3th"
  351. double tmp_3th = 29; // 三段压差
  352. // gotags: json:"flux_3th"
  353. double flux_3th = 30; // 三段通量
  354. // gotags: json:"permeability_3th"
  355. double permeability_3th = 31; // 三段渗透率
  356. // gotags: json:"feed_wq_turbidity"
  357. double feed_wq_turbidity = 32; // 进水浊度
  358. // gotags: json:"feed_wq_ph"
  359. int64 feed_wq_ph = 33; // 进水 PH 值
  360. // gotags: json:"product_wq_ph"
  361. int64 product_wq_ph = 34; // 产水 PH 值
  362. // gotags: json:"feed_wq_al"
  363. double feed_wq_al = 35; // 进水水质:铝
  364. // gotags: json:"product_wq_al"
  365. double product_wq_al = 36; // 产水水质:铝
  366. // gotags: json:"feed_wq_fe"
  367. double feed_wq_fe = 37; // 进水水质:铁
  368. // gotags: json:"product_wq_fe"
  369. double product_wq_fe = 38; // 产水水质:铁
  370. // gotags: json:"feed_wq_mn"
  371. double feed_wq_mn = 39; // 进水水质:锰
  372. // gotags: json:"product_wq_mn"
  373. double product_wq_mn = 40; // 产水水质:锰
  374. // gotags: json:"feed_wq_sio2"
  375. double feed_wq_sio2 = 41; // 进水水质:二氧化硅
  376. // gotags: json:"product_wq_sio2"
  377. double product_wq_sio2 = 42; // 产水水质:二氧化硅
  378. // gotags: json:"feed_wq_cod"
  379. double feed_wq_cod = 43; // 进水水质:COD
  380. // gotags: json:"product_wq_cod"
  381. double product_wq_cod = 44; // 产水水质:COD
  382. // gotags: json:"feed_wq_p"
  383. double feed_wq_p = 45; // 进水水质:磷
  384. // gotags: json:"product_wq_p"
  385. double product_wq_p = 46; // 产水水质:磷
  386. // gotags: json:"step"
  387. int64 step = 47; // 设备当前步序值
  388. // @gotags: json:"filter_time"
  389. double filter_time = 48;
  390. // @gotags: json:"filter_cycle"
  391. int64 filter_cycle = 49;
  392. // gotags: json:"c_time"
  393. string c_time = 50;
  394. }
  395. message WorkingChest {
  396. // @gotags: json:"id"
  397. int64 id = 1;
  398. // @gotags: json:"project_id"
  399. int64 project_id = 2;
  400. // @gotags: json:"device_code"
  401. string device_code = 3;
  402. // @gotags: json:"switch"
  403. int64 switch = 4; // 药箱液位开关 0: 关 1: 开
  404. // @gotags: json:"level"
  405. double level = 5; // 液位高度
  406. // @gotags: json:"agitator_status"
  407. int64 agitator_status = 6; // 搅拌器运行状态 0: 未运行 1:运行中
  408. // @gotags: json:"agitator_duration"
  409. int64 agitator_duration = 7; // 搅拌器运行时长
  410. // @gotags: json:"agitator_fault_status"
  411. int64 agitator_fault_status = 8; // 搅拌器故障状态 0:正常 1:故障
  412. // @gotags: json:"c_time"
  413. string c_time = 9;
  414. }
  415. message WorkingPump {
  416. // @gotags: json:"id"
  417. int64 id = 1;
  418. // @gotags: json:"project_id"
  419. int64 project_id = 2;
  420. // @gotags: json:"device_code"
  421. string device_code = 3;
  422. // @gotags: json:"feed_pressure"
  423. double feed_pressure = 4; // 进水压力
  424. // @gotags: json:"out_pressure"
  425. double out_pressure = 5; // 出水压力
  426. // @gotags: json:"duration"
  427. int64 duration = 6; // 运行时长 单位 s
  428. // @gotags: json:"current"
  429. double current = 7; // 运行电流
  430. // @gotags: json:"frequency"
  431. double frequency = 8; // 运行频率
  432. // @gotags: json:"lift"
  433. double lift = 9; // 工作扬程
  434. // @gotags: json:"efficiency"
  435. double efficiency = 10; // 运行效率
  436. // @gotags: json:"run_status"
  437. int64 run_status = 11; // 运行状态 0: 停机 1: 运行正常
  438. // @gotags: json:"fault_status"
  439. int64 fault_status = 12; // 故障状态 0: 正常 1: 故障
  440. // @gotags: json:"c_time"
  441. string c_time = 13;
  442. }
  443. message WorkingValve {
  444. // @gotags: json:"id"
  445. int64 id = 1;
  446. // @gotags: json:"project_id"
  447. int64 project_id = 2;
  448. // @gotags: json:"device_code"
  449. string device_code = 3;
  450. // @gotags: json:"adjust"
  451. int64 adjust = 4; // 是否为调节阀门 0: 否 1: 是
  452. // @gotags: json:"opening"
  453. double opening = 5; // 当前阀门的开度
  454. // @gotags: json:"closed"
  455. int64 closed = 6; // 关到位 全关 0: 否 1: 是
  456. // @gotags: json:"opened"
  457. int64 opened = 7; // 开到位 开到 设置的开度 0: 否 1: 是
  458. // @gotags: json:"fault_status"
  459. int64 fault_status = 8; // 是否故障 0: 否 1: 是
  460. // @gotags: json:"c_time"
  461. string c_time = 9;
  462. }
  463. message ItemHistoryData {
  464. // @gotags: json:"project_id"
  465. int64 project_id = 1;
  466. // @gotags: json:"item_name"
  467. string item_name = 2;
  468. // @gotags: json:"val"
  469. double val = 3;
  470. // @gotags: json:"h_time"
  471. string h_time = 4;
  472. }
  473. message MultiAddItemHistoryDataReq {
  474. // @gotags: json:"project_id"
  475. int64 project_id = 1;
  476. // @gotags: json:"list"
  477. repeated ItemHistoryData list = 2;
  478. }
  479. message MultiAddItemHistoryDataResp {}
  480. message ItemHistoryDataListReq {
  481. // @gotags: json:"project_id"
  482. int64 project_id = 1;
  483. // @gotags: json:"item_name"
  484. string item_name = 2;
  485. // @gotags: json:"interval"
  486. string interval = 3; //时间单位 s,minute,h,day
  487. // @gotags: json:"aggregator"
  488. string aggregator = 4; //聚合方式 min,max,avg,sum,realtime, new
  489. // @gotags: json:"stime"
  490. string stime = 5;
  491. // @gotags: json:"etime"
  492. string etime = 6;
  493. // @gotags: json:"size"
  494. int64 size = 7;
  495. // @gotags: json:"order"
  496. string order = 8;
  497. }
  498. message ItemHistoryDataByTimeReq {
  499. // @gotags: json:"project_id"
  500. int64 project_id = 1;
  501. // @gotags: json:"item_name"
  502. string item_name = 2;
  503. // @gotags: json:"stime"
  504. string stime = 3;
  505. // @gotags: json:"etime"
  506. string etime = 4;
  507. // @gotags: json:"order"
  508. string order = 5;
  509. }
  510. message ItemHistoryDataMaxMinResp {
  511. // @gotags: json:"max_val"
  512. double max_val = 1;
  513. // @gotags: json:"min_val"
  514. double min_val = 2;
  515. // @gotags: json:"avg_val"
  516. double avg_val = 3;
  517. }
  518. message ItemHistoryDataFirstLastResp {
  519. // @gotags: json:"first"
  520. double first = 1;
  521. // @gotags: json:"last"
  522. double last = 2;
  523. }
  524. message ChangeTypeItemHistoryDataResp {
  525. // @gotags: json:"value"
  526. double value = 1;
  527. }
  528. message ItemHistoryDataList {
  529. // @gotags: json:"item_name"
  530. string item_name = 1;
  531. // @gotags: json:"val"
  532. double val = 2;
  533. // @gotags: json:"h_time"
  534. string h_time = 3;
  535. }
  536. message ItemHistoryDataForChart {
  537. // @gotags: json:"name"
  538. string name = 1;
  539. // @gotags: json:"val"
  540. double val = 2;
  541. // @gotags: json:"htime_at"
  542. string htime_at = 3;
  543. }
  544. message ItemHistoryDataForChartReq {
  545. // @gotags: json:"project_id"
  546. int64 project_id = 1;
  547. // @gotags: json:"item_name"
  548. string item_name = 2;
  549. // @gotags: json:"stime"
  550. string stime = 3;
  551. // @gotags: json:"etime"
  552. string etime = 4;
  553. // @gotags: json:"interval"
  554. string interval = 5;
  555. // @gotags: json:"size"
  556. int64 size = 6;
  557. // @gotags: json:"aggregator"
  558. string aggregator = 7;
  559. // @gotags: json:"order"
  560. string order = 8;
  561. // @gotags: json:"max_val"
  562. double max_val = 9;
  563. // @gotags: json:"min_val"
  564. double min_val = 10;
  565. }
  566. message ItemHistoryDataForChartResp {
  567. // @gotags: json:"list"
  568. repeated ItemHistoryDataForChart list = 1;
  569. }
  570. message ItemHistoryDataListResp {
  571. // @gotags: json:"list"
  572. repeated ItemHistoryDataList list = 1;
  573. }
  574. message GetWorkingUfByCodeResp{
  575. // @gotags: json:"list"
  576. repeated WorkingUf list = 1;
  577. }
  578. message FindWorkingUfByCycleReq{
  579. int64 project_id = 1;
  580. string device_code = 2;
  581. int64 filter_cycle = 3;
  582. int64 step = 4;
  583. double filter_time_start = 5;
  584. double filter_time_end = 6;
  585. int64 limit = 7;
  586. }
  587. message FindWorkingUfByCycleResp{
  588. // @gotags: json:"list"
  589. repeated WorkingUf list = 1;
  590. }
  591. message GetWorkingRoByCodeResp{
  592. // @gotags: json:"list"
  593. repeated WorkingRo list = 1;
  594. }
  595. message GetWorkingNfByCodeResp{
  596. // @gotags: json:"list"
  597. repeated WorkingNf list = 1;
  598. }
  599. message GetWorkingMfByCodeResp{
  600. // @gotags: json:"list"
  601. repeated WorkingMf list = 1;
  602. }
  603. message GetWorkingPumpByCodeResp{
  604. // @gotags: json:"list"
  605. repeated WorkingPump list = 1;
  606. }
  607. message GetWorkingValveByCodeResp{
  608. // @gotags: json:"list"
  609. repeated WorkingValve list = 1;
  610. }
  611. message GetWorkingChestByCodeResp{
  612. // @gotags: json:"list"
  613. repeated WorkingChest list = 1;
  614. }
  615. message FindAppListReq {
  616. int64 page = 1;
  617. int64 page_size = 2;
  618. string order = 3; // 排序字段及方向 例: id desc
  619. }
  620. message FindAppListResp {
  621. repeated AppInfo list = 1;
  622. Pagination pagination = 2;
  623. }
  624. message GetAppInfoReq {
  625. string app_name = 1;
  626. }
  627. message GetAppInfoResp {
  628. AppInfo app_info = 1;
  629. }
  630. message CreateAppInfoReq {
  631. string app_name = 1;
  632. repeated int64 project_ids = 2;
  633. int64 expire = 3;
  634. }
  635. message CreateAppInfoResp {
  636. AppInfo app_info = 1;
  637. }
  638. message RemoveAppInfoReq {
  639. string app_name = 1;
  640. }
  641. message RemoveAppInfoResp {
  642. bool ok = 1;
  643. }
  644. message DisableAppInfoReq {
  645. string app_name = 1;
  646. }
  647. message DisableAppInfoResp {
  648. bool ok = 1;
  649. }
  650. message EnableAppInfoReq {
  651. string app_name = 1;
  652. }
  653. message EnableAppInfoResp {
  654. bool ok = 1;
  655. }
  656. message ResetAppSecretReq {
  657. string app_name = 1;
  658. }
  659. message ResetAppSecretResp {
  660. string secret = 1;
  661. }
  662. message ExpireAppSecretReq {
  663. string app_name = 1;
  664. int64 expire = 3;
  665. }
  666. message ExpireAppSecretResp {
  667. string expire_at = 3;
  668. }
  669. message ResetAppProjectReq {
  670. string app_name = 1;
  671. repeated int64 project_ids = 2;
  672. }
  673. message ResetAppProjectResp {
  674. repeated int64 remove_project_ids = 1;
  675. }
  676. message FindDataDescribeReq {
  677. int64 project_id = 1;
  678. repeated string items = 2;
  679. string st = 3;
  680. string et = 4;
  681. }
  682. message FindDataDescribeResp {
  683. map <string, DataDescribeInfo> list = 1;
  684. }
  685. message FindDataCorrelationReq {
  686. int64 project_id = 1;
  687. repeated string items = 2;
  688. string st = 3;
  689. string et = 4;
  690. }
  691. message FindDataMinAndMaxReq {
  692. int64 project_id = 1;
  693. repeated string items = 2;
  694. string st = 3;
  695. string et = 4;
  696. }
  697. message FindDataMinAndMaxResp {
  698. map <string, DataMinAndMaxInfo> list = 1;
  699. }
  700. message FindDataCorrelationResp {
  701. map <string, DataCorrelationInfo> list = 1;
  702. }
  703. message HealthReq {
  704. }
  705. message HealthResp {
  706. repeated string db = 1;
  707. repeated string redis = 2;
  708. repeated string mq = 3;
  709. string msg = 4;
  710. }
  711. message CurrentItem {
  712. string item_name = 1;
  713. string val = 2;
  714. string h_time = 3;
  715. }
  716. message CurrentDataReq {
  717. int64 project_id = 1;
  718. string item_name = 2;
  719. }
  720. message CurrentDataResp {
  721. repeated CurrentItem item = 1;
  722. }
  723. service Organization {
  724. rpc GetWorkingUfByCode(DcWorkingReq) returns(GetWorkingUfByCodeResp);
  725. rpc FindWorkingUfByCycle(FindWorkingUfByCycleReq) returns(FindWorkingUfByCycleResp);
  726. rpc GetWorkingRoByCode(DcWorkingReq) returns(GetWorkingRoByCodeResp);
  727. rpc GetWorkingChestByCode(DcWorkingReq) returns(GetWorkingChestByCodeResp);
  728. rpc GetWorkingPumpByCode(DcWorkingReq) returns(GetWorkingPumpByCodeResp);
  729. rpc GetWorkingValveByCode(DcWorkingReq) returns(GetWorkingValveByCodeResp);
  730. rpc MultiAddItemHistoryData(MultiAddItemHistoryDataReq) returns(MultiAddItemHistoryDataResp);
  731. rpc ItemHistoryDataList(ItemHistoryDataListReq) returns(ItemHistoryDataListResp);
  732. rpc ItemHistoryDataByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataListResp);
  733. rpc ItemHistoryDataMaxMinByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataMaxMinResp);
  734. rpc ItemHistoryDataFirstLastByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataFirstLastResp);
  735. rpc ChangeTypeItemHistoryData(ItemHistoryDataByTimeReq) returns(ChangeTypeItemHistoryDataResp);
  736. rpc ItemHistoryDataForChart(ItemHistoryDataForChartReq) returns(ItemHistoryDataForChartResp);
  737. rpc FindAppList (FindAppListReq) returns (FindAppListResp);
  738. rpc GetAppInfo (GetAppInfoReq) returns (GetAppInfoResp);
  739. rpc CreateAppInfo (CreateAppInfoReq) returns (CreateAppInfoResp);
  740. rpc RemoveAppInfo (RemoveAppInfoReq) returns (RemoveAppInfoResp);
  741. rpc DisableAppInfo (DisableAppInfoReq) returns (DisableAppInfoResp);
  742. rpc EnableAppInfo (EnableAppInfoReq) returns (EnableAppInfoResp);
  743. rpc ResetAppSecret (ResetAppSecretReq) returns (ResetAppSecretResp);
  744. rpc ExpireAppSecret (ExpireAppSecretReq) returns (ExpireAppSecretResp);
  745. rpc ResetAppProject (ResetAppProjectReq) returns (ResetAppProjectResp);
  746. rpc FindDataDescribe (FindDataDescribeReq) returns (FindDataDescribeResp);
  747. rpc FindDataMinAndMax (FindDataMinAndMaxReq) returns (FindDataMinAndMaxResp);
  748. rpc FindDataCorrelation (FindDataCorrelationReq) returns (FindDataCorrelationResp);
  749. rpc CurrentData (CurrentDataReq) returns (CurrentDataResp);
  750. rpc Health (HealthReq) returns (HealthResp);
  751. }