鼎鼎知识库
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

开放平台接口文档(内部版).md 29KB

3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
3 лет назад
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319
  1. # 鼎鼎开放平台
  2. 鼎鼎开放平台旨在集成物联网设备,赋能合作第三方或内部开发人员,使之可以进行围绕设备、与业务无关的开发。第一版的开放平台开始于2021年1月,对接了深圳曼顿公司物联网空开的`HTTP`和`UDP`协议。
  3. # 版本历史
  4. | 版本 | 修订内容 | 修订人 | 发布日期 |
  5. | ----- | ------------------------------------------------------------ | ------ | --------- |
  6. | 1.0.0 | 第一次发布。功能包括:合闸、分断、获取实时数据。 | 季建新 | 2021.1.12 |
  7. | 1.0.1 | 兼容`UDP`协议 | 季建新 | 2021.2.21 |
  8. | 1.0.2 | `HTTP`协议电量查询,实现按月、按天、按小时查询。 | 季建新 | 2021.2.21 |
  9. | 1.0.3 | `UDP`协议电量查询,实现按月、按天、按小时查询。 | 季建新 | 2021.2.21 |
  10. | 1.0.4 | 获取`HTTP`协议模块是否在线; 模块和项目绑定;模块和项目解除绑定;获取60分钟内负荷; 获取任意多开关任意时间段内的电量。 | 季建新 | 2021.3.19 |
  11. | 1.0.5 | 获取项目下的模块;获取项目下的所有模块及线路;获取任意多个线路的累积负荷;获取任意多开关任意时间段内的按小时、按天、按月电量;获取任意多开关任意时间段内的电量。 | 季建新 | 2021.3.22 |
  12. # 空气开关
  13. ## 获取实时数据
  14. 请求
  15. ```
  16. POST http://47.103.61.198:5008/api/breaker/data
  17. Headers:
  18. Content-Type: application/json
  19. DD-Open-Key: d2ca79f1-4666-4ad5-953b-7ba5ee480fe0
  20. Body:
  21. {
  22. "mac":"187ED53338C4"
  23. }
  24. ```
  25. 响应
  26. ```
  27. {
  28. "data": {
  29. "serverinfo": {
  30. "port": "12345",
  31. "hardware": "T25",
  32. "execleakcheck": "false",
  33. "protocol_ver": "19",
  34. "mac": "187ED53338C4",
  35. "loginid": "187ED53338C4",
  36. "gate": "",
  37. "ip": "192.168.8.134",
  38. "version": "1.3.08",
  39. "loginpwd": "7a57a5a743894ae4",
  40. "ssidpwd": "2803f88db851c67a",
  41. "ssid": "DDINGW",
  42. "timezoneId": "Asia/Shanghai",
  43. "ServerProtocol": "2",
  44. "server": "47.103.61.198:5008/ebx-bishop/data/carry",
  45. "datetime": "2021-01-25 14:24:56",
  46. "leakcheckdate": "3,13,33",
  47. "lastleakcheckdate": "2017-01-01 10:00:00"
  48. },
  49. "distributbox": {
  50. "breakers": {
  51. "1": {
  52. "version": "1.03",
  53. "title": "总路",
  54. "model": "JZK2L100-BL6523",
  55. "alarm": 0,
  56. "enableNetCtrl": true,
  57. "mxdw": 0,
  58. "mxgg": 14080,
  59. "mxgl": 96,
  60. "mxgw": 90,
  61. "mxgy": 260,
  62. "mxld": 30,
  63. "mxqy": 0,
  64. "openClose": true,
  65. "addr": 1,
  66. "power": 0,
  67. "specification": "64",
  68. "control": 1,
  69. "visibility": 1,
  70. "totalChannelId": -1,
  71. "lineType": "220",
  72. "a_A": 0,
  73. "a_T": 32.1,
  74. "a_V": 226,
  75. "a_WP": 0,
  76. "a_LD": 0.5,
  77. "a_PF": 0,
  78. "g_A": 0,
  79. "g_T": 0,
  80. "g_V": 0,
  81. "g_WP": 0,
  82. "g_LD": 0,
  83. "g_PF": 0,
  84. "b_A": 0,
  85. "b_T": 0,
  86. "b_V": 0,
  87. "b_WP": 0,
  88. "b_PF": 0,
  89. "c_A": 0,
  90. "c_T": 0,
  91. "c_V": 0,
  92. "c_WP": 0,
  93. "c_PF": 0,
  94. "n_A": 0,
  95. "n_T": 0
  96. },
  97. "2": {
  98. "version": "1.03",
  99. "title": "线路1",
  100. "model": "JZK2L100-BL6523",
  101. "alarm": 0,
  102. "enableNetCtrl": true,
  103. "mxdw": 0,
  104. "mxgg": 100,
  105. "mxgl": 30,
  106. "mxgw": 90,
  107. "mxgy": 260,
  108. "mxld": 30,
  109. "mxqy": 175,
  110. "openClose": true,
  111. "addr": 2,
  112. "power": 0,
  113. "specification": "20",
  114. "control": 1,
  115. "visibility": 1,
  116. "totalChannelId": 1,
  117. "lineType": "220",
  118. "a_A": 0,
  119. "a_T": 35,
  120. "a_V": 226,
  121. "a_WP": 0,
  122. "a_LD": 0,
  123. "a_PF": 0,
  124. "g_A": 0,
  125. "g_T": 0,
  126. "g_V": 0,
  127. "g_WP": 0,
  128. "g_LD": 0,
  129. "g_PF": 0,
  130. "b_A": 0,
  131. "b_T": 0,
  132. "b_V": 0,
  133. "b_WP": 0,
  134. "b_PF": 0,
  135. "c_A": 0,
  136. "c_T": 0,
  137. "c_V": 0,
  138. "c_WP": 0,
  139. "c_PF": 0,
  140. "n_A": 0,
  141. "n_T": 0
  142. },
  143. "3": {
  144. "version": "1.03",
  145. "title": "线路2",
  146. "model": "JZK2L100-BL6523",
  147. "alarm": 0,
  148. "enableNetCtrl": true,
  149. "mxdw": 0,
  150. "mxgg": 4400,
  151. "mxgl": 30,
  152. "mxgw": 90,
  153. "mxgy": 260,
  154. "mxld": 30,
  155. "mxqy": 175,
  156. "openClose": true,
  157. "addr": 3,
  158. "power": 0,
  159. "specification": "20",
  160. "control": 1,
  161. "visibility": 1,
  162. "totalChannelId": 1,
  163. "lineType": "220",
  164. "a_A": 0,
  165. "a_T": 35,
  166. "a_V": 226,
  167. "a_WP": 0,
  168. "a_LD": 0,
  169. "a_PF": 0,
  170. "g_A": 0,
  171. "g_T": 0,
  172. "g_V": 0,
  173. "g_WP": 0,
  174. "g_LD": 0,
  175. "g_PF": 0,
  176. "b_A": 0,
  177. "b_T": 0,
  178. "b_V": 0,
  179. "b_WP": 0,
  180. "b_PF": 0,
  181. "c_A": 0,
  182. "c_T": 0,
  183. "c_V": 0,
  184. "c_WP": 0,
  185. "c_PF": 0,
  186. "n_A": 0,
  187. "n_T": 0
  188. }
  189. },
  190. "change": null
  191. }
  192. },
  193. "isError": false,
  194. "message": "success",
  195. "code": 200
  196. }
  197. ```
  198. ## 合闸分断
  199. 请求
  200. ```
  201. POST http://47.103.61.198:5008/api/breaker/oc
  202. Headers:
  203. Content-Type: application/json
  204. DD-Open-Key: d2ca79f1-4666-4ad5-953b-7ba5ee480fe0
  205. Body:
  206. {
  207. "cmd":"OCSWITCH",
  208. "value1":"open",
  209. "value2":"1,2,3",
  210. "mac":"187ED53338C4",
  211. "extra":""
  212. }
  213. ```
  214. ## 批量获取模块是否在线
  215. 当总部运营后台展示模块是否在线时使用本接口。
  216. 请求
  217. ```
  218. POST http://47.103.61.198:5008/api/hd/macs
  219. Headers:
  220. Content-Type: application/json
  221. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  222. Body:
  223. {
  224. "Macs":["187ED5311111","187ED5322222"]
  225. }
  226. ```
  227. 响应
  228. ```
  229. {
  230. "data": {
  231. "macs": {
  232. "187ED5311111": "0",
  233. "187ED5322222": "0"
  234. }
  235. },
  236. "isError": false,
  237. "message": "success",
  238. "code": 200
  239. }
  240. ```
  241. ## 模块和项目绑定
  242. 当总部运营后台绑定模块和项目时使用本接口。
  243. 请求
  244. ```
  245. POST http://47.103.61.198:5008/api/hd/mac/bind
  246. Headers:
  247. Content-Type: application/json
  248. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  249. Body:
  250. {
  251. "Mac":"187ED5377777",
  252. "ProjectId":"1000",
  253. "ProjectName":"DEMO",
  254. "NSpace":"DEMO",
  255. "Protocol":0,
  256. "IsThirdParty":false,
  257. "APIKey":""
  258. }
  259. ```
  260. 以上,`Protocol=2`表示模块是`HTTP`通讯,`Protocol=1`表示模块是`UDP`通讯。如果在项目运营后台的组织属于第三方合作方,必须设置`IsThirdParty=true`,并且`APIKey`不能为空。
  261. 响应
  262. ```
  263. {
  264. "isError": false,
  265. "message": "success",
  266. "code": 200
  267. }
  268. ```
  269. ## 模块和项目解除绑定
  270. 当总部运营后台模块和项目解除绑定时使用本接口。
  271. 请求
  272. ```
  273. POST http://47.103.61.198:5008/api/hd/mac/unbind
  274. Headers:
  275. Content-Type: application/json
  276. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  277. Body:
  278. {
  279. "Mac":"187ED5377777"
  280. }
  281. ```
  282. 响应
  283. ```
  284. {
  285. "isError": false,
  286. "message": "success",
  287. "code": 200
  288. }
  289. ```
  290. ## 获取项目下的模块
  291. 请求
  292. ```
  293. POST http://47.103.61.198:5008/api/hd/macs/byproject
  294. Headers:
  295. Content-Type: application/json
  296. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  297. Body:
  298. {
  299. "ProjectId":"2"
  300. }
  301. ```
  302. 响应
  303. ```
  304. {
  305. "data": {
  306. "macs": [
  307. "187ED53338C4",
  308. "187ED5311111",
  309. "187ED5322222",
  310. "187ED5333333",
  311. "187ED5344444",
  312. "187ED5355555",
  313. "187ED5366666"
  314. ],
  315. "projectId": "2"
  316. },
  317. "isError": false,
  318. "message": "success",
  319. "code": 200
  320. }
  321. ```
  322. ## 获取项目下的所有模块及线路
  323. 请求
  324. ```
  325. POST http://47.103.61.198:5008/api/hd/addrs/byprojectmac
  326. Headers:
  327. Content-Type: application/json
  328. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  329. Body:
  330. {
  331. "ProjectId":"2"
  332. }
  333. ```
  334. 响应
  335. ```
  336. {
  337. "data": {
  338. "projectId": "2",
  339. "macs": {
  340. "187ED53338C4": [
  341. "1",
  342. "2",
  343. "3"
  344. ],
  345. "187ED5311111": [
  346. "1",
  347. "2",
  348. "3",
  349. "4",
  350. "5",
  351. "6",
  352. "7",
  353. "8",
  354. "9",
  355. "10"
  356. ],
  357. "187ED5322222": [
  358. "1",
  359. "2",
  360. "3",
  361. "4",
  362. "5",
  363. "6",
  364. "7",
  365. "8",
  366. "9",
  367. "10"
  368. ],
  369. "187ED5333333": [
  370. "1",
  371. "2",
  372. "3",
  373. "4",
  374. "5",
  375. "6",
  376. "7",
  377. "8",
  378. "9",
  379. "10"
  380. ],
  381. "187ED5344444": [
  382. "1",
  383. "2",
  384. "3",
  385. "4",
  386. "5",
  387. "6",
  388. "7",
  389. "8",
  390. "9",
  391. "10"
  392. ],
  393. "187ED5355555": [
  394. "1",
  395. "2",
  396. "3",
  397. "4",
  398. "5",
  399. "6",
  400. "7",
  401. "8",
  402. "9",
  403. "10"
  404. ],
  405. "187ED5366666": [
  406. "1",
  407. "2",
  408. "3",
  409. "4",
  410. "5",
  411. "6",
  412. "7",
  413. "8",
  414. "9",
  415. "10"
  416. ]
  417. }
  418. },
  419. "isError": false,
  420. "message": "success",
  421. "code": 200
  422. }
  423. ```
  424. ## 获取最近60分钟的负荷
  425. 当需要统计某个项目、公司、位置下的某些开关最近60分钟内负荷时调用本接口。
  426. 请求
  427. ```
  428. POST http://47.103.61.198:5008/api/breaker/fuhe
  429. Headers:
  430. Content-Type: application/json
  431. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  432. Body:
  433. {
  434. "Macs":["187ED5311111_1,2","187ED5322222_1,2,3"]
  435. }
  436. ```
  437. 响应
  438. ```
  439. {
  440. "data": {
  441. "fuHes": [
  442. {
  443. "dt": "2021-03-19T14:27:00",
  444. "wp": "400"
  445. },
  446. {
  447. "dt": "2021-03-19T14:28:00",
  448. "wp": "400"
  449. },
  450. {
  451. "dt": "2021-03-19T14:29:00",
  452. "wp": "400"
  453. },
  454. {
  455. "dt": "2021-03-19T14:30:00",
  456. "wp": "400"
  457. },
  458. {
  459. "dt": "2021-03-19T14:31:00",
  460. "wp": "400"
  461. },
  462. {
  463. "dt": "2021-03-19T14:32:00",
  464. "wp": "400"
  465. },
  466. {
  467. "dt": "2021-03-19T14:33:00",
  468. "wp": "400"
  469. },
  470. {
  471. "dt": "2021-03-19T14:34:00",
  472. "wp": "400"
  473. },
  474. {
  475. "dt": "2021-03-19T14:35:00",
  476. "wp": "400"
  477. },
  478. {
  479. "dt": "2021-03-19T14:36:00",
  480. "wp": "400"
  481. },
  482. {
  483. "dt": "2021-03-19T14:37:00",
  484. "wp": "400"
  485. },
  486. {
  487. "dt": "2021-03-19T14:38:00",
  488. "wp": "400"
  489. },
  490. {
  491. "dt": "2021-03-19T14:39:00",
  492. "wp": "400"
  493. },
  494. {
  495. "dt": "2021-03-19T14:40:00",
  496. "wp": "400"
  497. },
  498. {
  499. "dt": "2021-03-19T14:41:00",
  500. "wp": "400"
  501. },
  502. {
  503. "dt": "2021-03-19T14:42:00",
  504. "wp": "400"
  505. },
  506. {
  507. "dt": "2021-03-19T14:43:00",
  508. "wp": "400"
  509. },
  510. {
  511. "dt": "2021-03-19T14:44:00",
  512. "wp": "400"
  513. },
  514. {
  515. "dt": "2021-03-19T14:45:00",
  516. "wp": "400"
  517. },
  518. {
  519. "dt": "2021-03-19T14:46:00",
  520. "wp": "400"
  521. },
  522. {
  523. "dt": "2021-03-19T14:47:00",
  524. "wp": "400"
  525. },
  526. {
  527. "dt": "2021-03-19T14:48:00",
  528. "wp": "400"
  529. },
  530. {
  531. "dt": "2021-03-19T14:49:00",
  532. "wp": "400"
  533. },
  534. {
  535. "dt": "2021-03-19T14:50:00",
  536. "wp": "400"
  537. },
  538. {
  539. "dt": "2021-03-19T14:51:00",
  540. "wp": "400"
  541. },
  542. {
  543. "dt": "2021-03-19T14:52:00",
  544. "wp": "400"
  545. },
  546. {
  547. "dt": "2021-03-19T14:53:00",
  548. "wp": "400"
  549. },
  550. {
  551. "dt": "2021-03-19T14:54:00",
  552. "wp": "400"
  553. },
  554. {
  555. "dt": "2021-03-19T14:55:00",
  556. "wp": "400"
  557. },
  558. {
  559. "dt": "2021-03-19T14:56:00",
  560. "wp": "400"
  561. },
  562. {
  563. "dt": "2021-03-19T14:57:00",
  564. "wp": "400"
  565. },
  566. {
  567. "dt": "2021-03-19T14:58:00",
  568. "wp": "400"
  569. },
  570. {
  571. "dt": "2021-03-19T14:59:00",
  572. "wp": "400"
  573. },
  574. {
  575. "dt": "2021-03-19T15:00:00",
  576. "wp": "400"
  577. },
  578. {
  579. "dt": "2021-03-19T15:01:00",
  580. "wp": "400"
  581. },
  582. {
  583. "dt": "2021-03-19T15:02:00",
  584. "wp": "400"
  585. },
  586. {
  587. "dt": "2021-03-19T15:03:00",
  588. "wp": "400"
  589. },
  590. {
  591. "dt": "2021-03-19T15:04:00",
  592. "wp": "400"
  593. },
  594. {
  595. "dt": "2021-03-19T15:05:00",
  596. "wp": "400"
  597. },
  598. {
  599. "dt": "2021-03-19T15:06:00",
  600. "wp": "400"
  601. },
  602. {
  603. "dt": "2021-03-19T15:07:00",
  604. "wp": "400"
  605. },
  606. {
  607. "dt": "2021-03-19T15:08:00",
  608. "wp": "400"
  609. },
  610. {
  611. "dt": "2021-03-19T15:09:00",
  612. "wp": "400"
  613. },
  614. {
  615. "dt": "2021-03-19T15:10:00",
  616. "wp": "400"
  617. },
  618. {
  619. "dt": "2021-03-19T15:11:00",
  620. "wp": "400"
  621. },
  622. {
  623. "dt": "2021-03-19T15:12:00",
  624. "wp": "400"
  625. },
  626. {
  627. "dt": "2021-03-19T15:13:00",
  628. "wp": "400"
  629. },
  630. {
  631. "dt": "2021-03-19T15:14:00",
  632. "wp": "400"
  633. },
  634. {
  635. "dt": "2021-03-19T15:15:00",
  636. "wp": "400"
  637. },
  638. {
  639. "dt": "2021-03-19T15:16:00",
  640. "wp": "400"
  641. },
  642. {
  643. "dt": "2021-03-19T15:17:00",
  644. "wp": "400"
  645. },
  646. {
  647. "dt": "2021-03-19T15:18:00",
  648. "wp": "400"
  649. },
  650. {
  651. "dt": "2021-03-19T15:19:00",
  652. "wp": "400"
  653. },
  654. {
  655. "dt": "2021-03-19T15:20:00",
  656. "wp": "400"
  657. },
  658. {
  659. "dt": "2021-03-19T15:21:00",
  660. "wp": "400"
  661. },
  662. {
  663. "dt": "2021-03-19T15:22:00",
  664. "wp": "400"
  665. },
  666. {
  667. "dt": "2021-03-19T15:23:00",
  668. "wp": "400"
  669. },
  670. {
  671. "dt": "2021-03-19T15:24:00",
  672. "wp": "400"
  673. },
  674. {
  675. "dt": "2021-03-19T15:25:00",
  676. "wp": "400"
  677. },
  678. {
  679. "dt": "2021-03-19T15:26:00",
  680. "wp": "400"
  681. },
  682. {
  683. "dt": "2021-03-19T15:28:00",
  684. "wp": "400"
  685. },
  686. {
  687. "dt": "2021-03-19T15:29:00",
  688. "wp": "400"
  689. },
  690. {
  691. "dt": "2021-03-19T15:30:00",
  692. "wp": "400"
  693. },
  694. {
  695. "dt": "2021-03-19T15:31:00",
  696. "wp": "400"
  697. }
  698. ]
  699. },
  700. "isError": false,
  701. "message": "success",
  702. "code": 200
  703. }
  704. ```
  705. ## 获取任意多个线路的累积负荷
  706. 请求
  707. ```
  708. POST http://47.103.61.198:5008/api/breaker/fuhe/byaddr
  709. Headers:
  710. Content-Type: application/json
  711. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  712. Body:
  713. {
  714. "Macs":["187ED5311111_1", "187ED5322222_2"]//一个元素就代表一个开关,不能是187ED5311111_1,2
  715. }
  716. ```
  717. 响应
  718. ```
  719. {
  720. "data": {
  721. "macs": {
  722. "187ED5311111_1": 48.9,
  723. "187ED5322222_2": 123.8
  724. }
  725. },
  726. "isError": false,
  727. "message": "success",
  728. "code": 200
  729. }
  730. ```
  731. ## 统计任意多开关任意时间段内的总电量
  732. 请求
  733. ```
  734. POST http://47.103.61.198:5008/api/breaker/power/random
  735. Headers:
  736. Content-Type: application/json
  737. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  738. Body:
  739. {
  740. "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
  741. "StartYear":2021,
  742. "StartMonth":3,
  743. "StartDay":1,
  744. "StartHour":0,
  745. "EndYear":2021,
  746. "EndMonth":3,
  747. "EndDay":15,
  748. "EndHour":0
  749. }
  750. ```
  751. 响应:
  752. ```
  753. {
  754. "data": {
  755. "total": "242.64"
  756. },
  757. "isError": false,
  758. "message": "success",
  759. "code": 200
  760. }
  761. ```
  762. ## 获取任意多开关任意时间段内的按小时、按天、按月电量
  763. 请求, 按小时
  764. ```
  765. POST http://47.103.61.198:5008/api/breaker/power/random/by
  766. Headers:
  767. Content-Type: application/json
  768. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  769. Body:
  770. {
  771. "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
  772. "StartYear":2021,
  773. "StartMonth":3,
  774. "StartDay":1,
  775. "StartHour":0,
  776. "EndYear":2021,
  777. "EndMonth":3,
  778. "EndDay":5,
  779. "EndHour":0,
  780. "PType":"HOURS"
  781. }
  782. ```
  783. 响应, 按小时
  784. ```
  785. {
  786. "data": {
  787. "pType": "HOURS",
  788. "powers": {
  789. "2021-03-01 00:00:00.000": 0.72,
  790. "2021-03-01 01:00:00.000": 0.72,
  791. "2021-03-01 02:00:00.000": 0.72,
  792. "2021-03-01 03:00:00.000": 0.72,
  793. "2021-03-01 04:00:00.000": 0.72,
  794. "2021-03-01 05:00:00.000": 0.72,
  795. "2021-03-01 06:00:00.000": 0.72,
  796. "2021-03-01 07:00:00.000": 0.72,
  797. "2021-03-01 08:00:00.000": 0.72,
  798. "2021-03-01 09:00:00.000": 0.72,
  799. "2021-03-01 10:00:00.000": 0.72,
  800. "2021-03-01 11:00:00.000": 0.72,
  801. "2021-03-01 12:00:00.000": 0.72,
  802. "2021-03-01 13:00:00.000": 0.72,
  803. "2021-03-01 14:00:00.000": 0.72,
  804. "2021-03-01 15:00:00.000": 0.72,
  805. "2021-03-01 16:00:00.000": 0.72,
  806. "2021-03-01 17:00:00.000": 0.72,
  807. "2021-03-01 18:00:00.000": 0.72,
  808. "2021-03-01 19:00:00.000": 0.72,
  809. "2021-03-01 20:00:00.000": 0.72,
  810. "2021-03-01 21:00:00.000": 0.72,
  811. "2021-03-01 22:00:00.000": 0.72,
  812. "2021-03-01 23:00:00.000": 0.72,
  813. "2021-03-02 00:00:00.000": 0.72,
  814. "2021-03-02 01:00:00.000": 0.72,
  815. "2021-03-02 02:00:00.000": 0.72,
  816. "2021-03-02 03:00:00.000": 0.72,
  817. "2021-03-02 04:00:00.000": 0.72,
  818. "2021-03-02 05:00:00.000": 0.72,
  819. "2021-03-02 06:00:00.000": 0.72,
  820. "2021-03-02 07:00:00.000": 0.72,
  821. "2021-03-02 08:00:00.000": 0.72,
  822. "2021-03-02 09:00:00.000": 0.72,
  823. "2021-03-02 10:00:00.000": 0.72,
  824. "2021-03-02 11:00:00.000": 0.72,
  825. "2021-03-02 12:00:00.000": 0.72,
  826. "2021-03-02 13:00:00.000": 0.72,
  827. "2021-03-02 14:00:00.000": 0.72,
  828. "2021-03-02 15:00:00.000": 0.72,
  829. "2021-03-02 16:00:00.000": 0.72,
  830. "2021-03-02 17:00:00.000": 0.72,
  831. "2021-03-02 18:00:00.000": 0.72,
  832. "2021-03-02 19:00:00.000": 0.72,
  833. "2021-03-02 20:00:00.000": 0.72,
  834. "2021-03-02 21:00:00.000": 0.72,
  835. "2021-03-02 22:00:00.000": 0.72,
  836. "2021-03-02 23:00:00.000": 0.72,
  837. "2021-03-03 00:00:00.000": 0.72,
  838. "2021-03-03 01:00:00.000": 0.72,
  839. "2021-03-03 02:00:00.000": 0.72,
  840. "2021-03-03 03:00:00.000": 0.72,
  841. "2021-03-03 04:00:00.000": 0.72,
  842. "2021-03-03 05:00:00.000": 0.72,
  843. "2021-03-03 06:00:00.000": 0.72,
  844. "2021-03-03 07:00:00.000": 0.72,
  845. "2021-03-03 08:00:00.000": 0.72,
  846. "2021-03-03 09:00:00.000": 0.72,
  847. "2021-03-03 10:00:00.000": 0.72,
  848. "2021-03-03 11:00:00.000": 0.72,
  849. "2021-03-03 12:00:00.000": 0.72,
  850. "2021-03-03 13:00:00.000": 0.72,
  851. "2021-03-03 14:00:00.000": 0.72,
  852. "2021-03-03 15:00:00.000": 0.72,
  853. "2021-03-03 16:00:00.000": 0.72,
  854. "2021-03-03 17:00:00.000": 0.72,
  855. "2021-03-03 18:00:00.000": 0.72,
  856. "2021-03-03 19:00:00.000": 0.72,
  857. "2021-03-03 20:00:00.000": 0.72,
  858. "2021-03-03 21:00:00.000": 0.72,
  859. "2021-03-03 22:00:00.000": 0.72,
  860. "2021-03-03 23:00:00.000": 0.72,
  861. "2021-03-04 00:00:00.000": 0.72,
  862. "2021-03-04 01:00:00.000": 0.72,
  863. "2021-03-04 02:00:00.000": 0.72,
  864. "2021-03-04 03:00:00.000": 0.72,
  865. "2021-03-04 04:00:00.000": 0.72,
  866. "2021-03-04 05:00:00.000": 0.72,
  867. "2021-03-04 06:00:00.000": 0.72,
  868. "2021-03-04 07:00:00.000": 0.72,
  869. "2021-03-04 08:00:00.000": 0.72,
  870. "2021-03-04 09:00:00.000": 0.72,
  871. "2021-03-04 10:00:00.000": 0.72,
  872. "2021-03-04 11:00:00.000": 0.72,
  873. "2021-03-04 12:00:00.000": 0.72,
  874. "2021-03-04 13:00:00.000": 0.72,
  875. "2021-03-04 14:00:00.000": 0.72,
  876. "2021-03-04 15:00:00.000": 0.72,
  877. "2021-03-04 16:00:00.000": 0.72,
  878. "2021-03-04 17:00:00.000": 0.72,
  879. "2021-03-04 18:00:00.000": 0.72,
  880. "2021-03-04 19:00:00.000": 0.72,
  881. "2021-03-04 20:00:00.000": 0.72,
  882. "2021-03-04 21:00:00.000": 0.72,
  883. "2021-03-04 22:00:00.000": 0.72,
  884. "2021-03-04 23:00:00.000": 0.72,
  885. "2021-03-05 00:00:00.000": 0.72
  886. }
  887. },
  888. "isError": false,
  889. "message": "success",
  890. "code": 200
  891. }
  892. ```
  893. 请求, 按天
  894. ```
  895. POST http://47.103.61.198:5008/api/breaker/power/random/by
  896. Headers:
  897. Content-Type: application/json
  898. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  899. Body:
  900. {
  901. "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
  902. "StartYear":2021,
  903. "StartMonth":3,
  904. "StartDay":1,
  905. "StartHour":0,
  906. "EndYear":2021,
  907. "EndMonth":3,
  908. "EndDay":5,
  909. "EndHour":0,
  910. "PType":"DAY"
  911. }
  912. ```
  913. 响应, 按天
  914. ```
  915. {
  916. "data": {
  917. "pType": "DAY",
  918. "powers": {
  919. "2021-03-01 00:00:00.000": 42.5,
  920. "2021-03-02 00:00:00.000": 42.5,
  921. "2021-03-03 00:00:00.000": 42.5,
  922. "2021-03-04 00:00:00.000": 42.5,
  923. "2021-03-05 00:00:00.000": 42.5
  924. }
  925. },
  926. "isError": false,
  927. "message": "success",
  928. "code": 200
  929. }
  930. ```
  931. 请求,按月
  932. ```
  933. POST http://47.103.61.198:5008/api/breaker/power/random/by
  934. Headers:
  935. Content-Type: application/json
  936. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  937. {
  938. "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
  939. "StartYear":2021,
  940. "StartMonth":1,
  941. "StartDay":1,
  942. "StartHour":0,
  943. "EndYear":2021,
  944. "EndMonth":3,
  945. "EndDay":5,
  946. "EndHour":0,
  947. "PType":"MONTH"
  948. }
  949. ```
  950. 响应,按月
  951. ```
  952. {
  953. "data": {
  954. "pType": "MONTH",
  955. "powers": {
  956. "2021-01-01 00:00:00.000": 356,
  957. "2021-02-01 00:00:00.000": 347,
  958. "2021-03-01 00:00:00.000": 359
  959. }
  960. },
  961. "isError": false,
  962. "message": "success",
  963. "code": 200
  964. }
  965. ```
  966. ## 获取任意多开关任意时间段内的电量
  967. 请求
  968. ```
  969. POST http://47.103.61.198:5008/api/breaker/power/random/byaddr
  970. Headers:
  971. Content-Type: application/json
  972. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  973. {
  974. "MacAddrs":["187ED5311111_1", "187ED5322222_2"],
  975. "StartYear":2021,
  976. "StartMonth":1,
  977. "StartDay":1,
  978. "StartHour":0,
  979. "EndYear":2021,
  980. "EndMonth":3,
  981. "EndDay":5,
  982. "EndHour":0
  983. }
  984. ```
  985. 响应
  986. ```
  987. {
  988. "data": {
  989. "powers": {
  990. "187ED5311111_1": 641.15,
  991. "187ED5322222_2": 398.77
  992. }
  993. },
  994. "isError": false,
  995. "message": "success",
  996. "code": 200
  997. }
  998. ```
  999. ## 获取任意多模块任意线路的报警
  1000. 请求
  1001. ```
  1002. POST http://47.103.61.198:5008/api/breaker/warning/bymacs
  1003. Headers:
  1004. Content-Type: application/json
  1005. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  1006. {
  1007. "Macs":["187ED5311111_2","187ED53338C4_1"],
  1008. "StartYear":2021,
  1009. "StartMonth":3,
  1010. "StartDay":1,
  1011. "StartHour":0,
  1012. "EndYear":2021,
  1013. "EndMonth":3,
  1014. "EndDay":2,
  1015. "EndHour":0
  1016. }
  1017. ```
  1018. 响应
  1019. ```
  1020. {
  1021. "data": {
  1022. "warnings": [
  1023. {
  1024. "addr": 2,
  1025. "start": "2021-03-01 04:04:00.000",
  1026. "end": "2021-03-01 05:04:00.000",
  1027. "wtype": "0",
  1028. "level": 3,
  1029. "val": "265 v",
  1030. "limit": "260 V",
  1031. "mac": "187ed5311111",
  1032. "ts": "2021-03-18 15:26:10.724"
  1033. },
  1034. {
  1035. "addr": 2,
  1036. "start": "2021-03-01 05:05:00.000",
  1037. "end": "2021-03-01 06:05:00.000",
  1038. "wtype": "0",
  1039. "level": 3,
  1040. "val": "100 V",
  1041. "limit": "175 V",
  1042. "mac": "187ed5311111",
  1043. "ts": "2021-03-18 15:26:26.468"
  1044. },
  1045. ......
  1046. ]
  1047. },
  1048. "isError": false,
  1049. "message": "success",
  1050. "code": 200
  1051. }
  1052. ```
  1053. ## 获取某个线路的报警
  1054. 请求
  1055. ```
  1056. POST http://47.103.61.198:5008/api/breaker/power/random/byaddr
  1057. Headers:
  1058. Content-Type: application/json
  1059. DD-Open-Key: bde2d876-993d-440d-aba1-3a06007a25a3
  1060. {
  1061. "Mac":"187ED5311111",
  1062. "Addr":2,
  1063. "StartYear":2021,
  1064. "StartMonth":3,
  1065. "StartDay":1,
  1066. "StartHour":0,
  1067. "EndYear":2021,
  1068. "EndMonth":3,
  1069. "EndDay":2,
  1070. "EndHour":0
  1071. }
  1072. ```
  1073. 响应
  1074. ```
  1075. {
  1076. "data": {
  1077. "warnings": [
  1078. {
  1079. "addr": 2,
  1080. "start": "2021-03-01 04:04:00.000",
  1081. "end": "2021-03-01 05:04:00.000",
  1082. "wtype": "0",
  1083. "level": 3,
  1084. "val": "265 v",
  1085. "limit": "260 V",
  1086. "mac": "187ed5311111",
  1087. "ts": "2021-03-18 15:26:10.724"
  1088. },
  1089. {
  1090. "addr": 2,
  1091. "start": "2021-03-01 05:05:00.000",
  1092. "end": "2021-03-01 06:05:00.000",
  1093. "wtype": "0",
  1094. "level": 3,
  1095. "val": "100 V",
  1096. "limit": "175 V",
  1097. "mac": "187ed5311111",
  1098. "ts": "2021-03-18 15:26:26.468"
  1099. },
  1100. ......
  1101. ]
  1102. },
  1103. "isError": false,
  1104. "message": "success",
  1105. "code": 200
  1106. }
  1107. ```