鼎鼎知识库
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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

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