datacenter.proto 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  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:"c_time"
  389. string c_time = 48;
  390. }
  391. message WorkingChest {
  392. // @gotags: json:"id"
  393. int64 id = 1;
  394. // @gotags: json:"project_id"
  395. int64 project_id = 2;
  396. // @gotags: json:"device_code"
  397. string device_code = 3;
  398. // @gotags: json:"switch"
  399. int64 switch = 4; // 药箱液位开关 0: 关 1: 开
  400. // @gotags: json:"level"
  401. double level = 5; // 液位高度
  402. // @gotags: json:"agitator_status"
  403. int64 agitator_status = 6; // 搅拌器运行状态 0: 未运行 1:运行中
  404. // @gotags: json:"agitator_duration"
  405. int64 agitator_duration = 7; // 搅拌器运行时长
  406. // @gotags: json:"agitator_fault_status"
  407. int64 agitator_fault_status = 8; // 搅拌器故障状态 0:正常 1:故障
  408. // @gotags: json:"c_time"
  409. string c_time = 9;
  410. }
  411. message WorkingPump {
  412. // @gotags: json:"id"
  413. int64 id = 1;
  414. // @gotags: json:"project_id"
  415. int64 project_id = 2;
  416. // @gotags: json:"device_code"
  417. string device_code = 3;
  418. // @gotags: json:"feed_pressure"
  419. double feed_pressure = 4; // 进水压力
  420. // @gotags: json:"out_pressure"
  421. double out_pressure = 5; // 出水压力
  422. // @gotags: json:"duration"
  423. int64 duration = 6; // 运行时长 单位 s
  424. // @gotags: json:"current"
  425. double current = 7; // 运行电流
  426. // @gotags: json:"frequency"
  427. double frequency = 8; // 运行频率
  428. // @gotags: json:"lift"
  429. double lift = 9; // 工作扬程
  430. // @gotags: json:"efficiency"
  431. double efficiency = 10; // 运行效率
  432. // @gotags: json:"run_status"
  433. int64 run_status = 11; // 运行状态 0: 停机 1: 运行正常
  434. // @gotags: json:"fault_status"
  435. int64 fault_status = 12; // 故障状态 0: 正常 1: 故障
  436. // @gotags: json:"c_time"
  437. string c_time = 13;
  438. }
  439. message WorkingValve {
  440. // @gotags: json:"id"
  441. int64 id = 1;
  442. // @gotags: json:"project_id"
  443. int64 project_id = 2;
  444. // @gotags: json:"device_code"
  445. string device_code = 3;
  446. // @gotags: json:"adjust"
  447. int64 adjust = 4; // 是否为调节阀门 0: 否 1: 是
  448. // @gotags: json:"opening"
  449. double opening = 5; // 当前阀门的开度
  450. // @gotags: json:"closed"
  451. int64 closed = 6; // 关到位 全关 0: 否 1: 是
  452. // @gotags: json:"opened"
  453. int64 opened = 7; // 开到位 开到 设置的开度 0: 否 1: 是
  454. // @gotags: json:"fault_status"
  455. int64 fault_status = 8; // 是否故障 0: 否 1: 是
  456. // @gotags: json:"c_time"
  457. string c_time = 9;
  458. }
  459. message ItemHistoryData {
  460. // @gotags: json:"project_id"
  461. int64 project_id = 1;
  462. // @gotags: json:"item_name"
  463. string item_name = 2;
  464. // @gotags: json:"val"
  465. double val = 3;
  466. // @gotags: json:"h_time"
  467. string h_time = 4;
  468. }
  469. message MultiAddItemHistoryDataReq {
  470. // @gotags: json:"project_id"
  471. int64 project_id = 1;
  472. // @gotags: json:"list"
  473. repeated ItemHistoryData list = 2;
  474. }
  475. message MultiAddItemHistoryDataResp {}
  476. message ItemHistoryDataListReq {
  477. // @gotags: json:"project_id"
  478. int64 project_id = 1;
  479. // @gotags: json:"item_name"
  480. string item_name = 2;
  481. // @gotags: json:"interval"
  482. string interval = 3; //时间单位 s,minute,h,day
  483. // @gotags: json:"aggregator"
  484. string aggregator = 4; //聚合方式 min,max,avg,sum,realtime, new
  485. // @gotags: json:"stime"
  486. string stime = 5;
  487. // @gotags: json:"etime"
  488. string etime = 6;
  489. // @gotags: json:"size"
  490. int64 size = 7;
  491. // @gotags: json:"order"
  492. string order = 8;
  493. }
  494. message ItemHistoryDataByTimeReq {
  495. // @gotags: json:"project_id"
  496. int64 project_id = 1;
  497. // @gotags: json:"item_name"
  498. string item_name = 2;
  499. // @gotags: json:"stime"
  500. string stime = 3;
  501. // @gotags: json:"etime"
  502. string etime = 4;
  503. // @gotags: json:"order"
  504. string order = 5;
  505. }
  506. message ItemHistoryDataMaxMinResp {
  507. // @gotags: json:"max_val"
  508. double max_val = 1;
  509. // @gotags: json:"min_val"
  510. double min_val = 2;
  511. // @gotags: json:"avg_val"
  512. double avg_val = 3;
  513. }
  514. message ItemHistoryDataFirstLastResp {
  515. // @gotags: json:"first"
  516. double first = 1;
  517. // @gotags: json:"last"
  518. double last = 2;
  519. }
  520. message ChangeTypeItemHistoryDataResp {
  521. // @gotags: json:"value"
  522. double value = 1;
  523. }
  524. message ItemHistoryDataList {
  525. // @gotags: json:"item_name"
  526. string item_name = 1;
  527. // @gotags: json:"val"
  528. double val = 2;
  529. // @gotags: json:"h_time"
  530. string h_time = 3;
  531. }
  532. message ItemHistoryDataForChart {
  533. // @gotags: json:"name"
  534. string name = 1;
  535. // @gotags: json:"val"
  536. double val = 2;
  537. // @gotags: json:"htime_at"
  538. string htime_at = 3;
  539. }
  540. message ItemHistoryDataForChartReq {
  541. // @gotags: json:"project_id"
  542. int64 project_id = 1;
  543. // @gotags: json:"item_name"
  544. string item_name = 2;
  545. // @gotags: json:"stime"
  546. string stime = 3;
  547. // @gotags: json:"etime"
  548. string etime = 4;
  549. // @gotags: json:"interval"
  550. string interval = 5;
  551. // @gotags: json:"size"
  552. int64 size = 6;
  553. // @gotags: json:"aggregator"
  554. string aggregator = 7;
  555. // @gotags: json:"order"
  556. string order = 8;
  557. // @gotags: json:"max_val"
  558. double max_val = 9;
  559. // @gotags: json:"min_val"
  560. double min_val = 10;
  561. }
  562. message ItemHistoryDataForChartResp {
  563. // @gotags: json:"list"
  564. repeated ItemHistoryDataForChart list = 1;
  565. }
  566. message ItemHistoryDataListResp {
  567. // @gotags: json:"list"
  568. repeated ItemHistoryDataList list = 1;
  569. }
  570. message GetWorkingUfByCodeResp{
  571. // @gotags: json:"list"
  572. repeated WorkingUf list = 1;
  573. }
  574. message FindWorkingUfByCycleReq{
  575. int64 project_id = 1;
  576. string device_code = 2;
  577. int64 filter_cycle = 3;
  578. int64 step = 4;
  579. double filter_time_start = 5;
  580. double filter_time_end = 6;
  581. int64 limit = 7;
  582. }
  583. message FindWorkingUfByCycleResp{
  584. // @gotags: json:"list"
  585. repeated WorkingUf list = 1;
  586. }
  587. message GetWorkingRoByCodeResp{
  588. // @gotags: json:"list"
  589. repeated WorkingRo list = 1;
  590. }
  591. message GetWorkingNfByCodeResp{
  592. // @gotags: json:"list"
  593. repeated WorkingNf list = 1;
  594. }
  595. message GetWorkingMfByCodeResp{
  596. // @gotags: json:"list"
  597. repeated WorkingMf list = 1;
  598. }
  599. message GetWorkingPumpByCodeResp{
  600. // @gotags: json:"list"
  601. repeated WorkingPump list = 1;
  602. }
  603. message GetWorkingValveByCodeResp{
  604. // @gotags: json:"list"
  605. repeated WorkingValve list = 1;
  606. }
  607. message GetWorkingChestByCodeResp{
  608. // @gotags: json:"list"
  609. repeated WorkingChest list = 1;
  610. }
  611. message FindAppListReq {
  612. int64 page = 1;
  613. int64 page_size = 2;
  614. string order = 3; // 排序字段及方向 例: id desc
  615. }
  616. message FindAppListResp {
  617. repeated AppInfo list = 1;
  618. Pagination pagination = 2;
  619. }
  620. message GetAppInfoReq {
  621. string app_name = 1;
  622. }
  623. message GetAppInfoResp {
  624. AppInfo app_info = 1;
  625. }
  626. message CreateAppInfoReq {
  627. string app_name = 1;
  628. repeated int64 project_ids = 2;
  629. int64 expire = 3;
  630. }
  631. message CreateAppInfoResp {
  632. AppInfo app_info = 1;
  633. }
  634. message RemoveAppInfoReq {
  635. string app_name = 1;
  636. }
  637. message RemoveAppInfoResp {
  638. bool ok = 1;
  639. }
  640. message DisableAppInfoReq {
  641. string app_name = 1;
  642. }
  643. message DisableAppInfoResp {
  644. bool ok = 1;
  645. }
  646. message EnableAppInfoReq {
  647. string app_name = 1;
  648. }
  649. message EnableAppInfoResp {
  650. bool ok = 1;
  651. }
  652. message ResetAppSecretReq {
  653. string app_name = 1;
  654. }
  655. message ResetAppSecretResp {
  656. string secret = 1;
  657. }
  658. message ExpireAppSecretReq {
  659. string app_name = 1;
  660. int64 expire = 3;
  661. }
  662. message ExpireAppSecretResp {
  663. string expire_at = 3;
  664. }
  665. message ResetAppProjectReq {
  666. string app_name = 1;
  667. repeated int64 project_ids = 2;
  668. }
  669. message ResetAppProjectResp {
  670. repeated int64 remove_project_ids = 1;
  671. }
  672. message FindDataDescribeReq {
  673. int64 project_id = 1;
  674. repeated string items = 2;
  675. string st = 3;
  676. string et = 4;
  677. }
  678. message FindDataDescribeResp {
  679. map <string, DataDescribeInfo> list = 1;
  680. }
  681. message FindDataCorrelationReq {
  682. int64 project_id = 1;
  683. repeated string items = 2;
  684. string st = 3;
  685. string et = 4;
  686. }
  687. message FindDataMinAndMaxReq {
  688. int64 project_id = 1;
  689. repeated string items = 2;
  690. string st = 3;
  691. string et = 4;
  692. }
  693. message FindDataMinAndMaxResp {
  694. map <string, DataMinAndMaxInfo> list = 1;
  695. }
  696. message FindDataCorrelationResp {
  697. map <string, DataCorrelationInfo> list = 1;
  698. }
  699. message HealthReq {
  700. }
  701. message HealthResp {
  702. repeated string db = 1;
  703. repeated string redis = 2;
  704. repeated string mq = 3;
  705. string msg = 4;
  706. }
  707. service Organization {
  708. rpc GetWorkingUfByCode(DcWorkingReq) returns(GetWorkingUfByCodeResp);
  709. rpc FindWorkingUfByCycle(FindWorkingUfByCycleReq) returns(FindWorkingUfByCycleResp);
  710. rpc GetWorkingRoByCode(DcWorkingReq) returns(GetWorkingRoByCodeResp);
  711. rpc GetWorkingChestByCode(DcWorkingReq) returns(GetWorkingChestByCodeResp);
  712. rpc GetWorkingPumpByCode(DcWorkingReq) returns(GetWorkingPumpByCodeResp);
  713. rpc GetWorkingValveByCode(DcWorkingReq) returns(GetWorkingValveByCodeResp);
  714. rpc MultiAddItemHistoryData(MultiAddItemHistoryDataReq) returns(MultiAddItemHistoryDataResp);
  715. rpc ItemHistoryDataList(ItemHistoryDataListReq) returns(ItemHistoryDataListResp);
  716. rpc ItemHistoryDataByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataListResp);
  717. rpc ItemHistoryDataMaxMinByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataMaxMinResp);
  718. rpc ItemHistoryDataFirstLastByTime(ItemHistoryDataByTimeReq) returns(ItemHistoryDataFirstLastResp);
  719. rpc ChangeTypeItemHistoryData(ItemHistoryDataByTimeReq) returns(ChangeTypeItemHistoryDataResp);
  720. rpc ItemHistoryDataForChart(ItemHistoryDataForChartReq) returns(ItemHistoryDataForChartResp);
  721. rpc FindAppList (FindAppListReq) returns (FindAppListResp);
  722. rpc GetAppInfo (GetAppInfoReq) returns (GetAppInfoResp);
  723. rpc CreateAppInfo (CreateAppInfoReq) returns (CreateAppInfoResp);
  724. rpc RemoveAppInfo (RemoveAppInfoReq) returns (RemoveAppInfoResp);
  725. rpc DisableAppInfo (DisableAppInfoReq) returns (DisableAppInfoResp);
  726. rpc EnableAppInfo (EnableAppInfoReq) returns (EnableAppInfoResp);
  727. rpc ResetAppSecret (ResetAppSecretReq) returns (ResetAppSecretResp);
  728. rpc ExpireAppSecret (ExpireAppSecretReq) returns (ExpireAppSecretResp);
  729. rpc ResetAppProject (ResetAppProjectReq) returns (ResetAppProjectResp);
  730. rpc FindDataDescribe (FindDataDescribeReq) returns (FindDataDescribeResp);
  731. rpc FindDataMinAndMax (FindDataMinAndMaxReq) returns (FindDataMinAndMaxResp);
  732. rpc FindDataCorrelation (FindDataCorrelationReq) returns (FindDataCorrelationResp);
  733. rpc Health (HealthReq) returns (HealthResp);
  734. }