fix:设备修改接口添加

V0.5.x
tangfudong 2023-06-30 11:35:52 +08:00
parent a748b7c2ce
commit 06678173c9
5 changed files with 299 additions and 141 deletions

View File

@ -7,8 +7,10 @@
"secret": "rMAweEJrE7cxbQWa",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655415536032
@ -35,8 +37,10 @@
"secret": "eN4PjDhH4yx4mrmi",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655415536130
@ -63,8 +67,10 @@
"secret": "ePSkE7bzGMsR6rTs",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655415536135
@ -91,8 +97,10 @@
"secret": "mkQiSDk4rF3EWKFM",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416465031
@ -122,8 +130,10 @@
"secret": "p72KAZyTA42zi8cJ",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416465035
@ -149,8 +159,10 @@
"secret": "xnKZZyPKj2rH6ee3",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416465133
@ -180,8 +192,10 @@
"secret": "PDkTxHPfw2H4WZjQ",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416465231
@ -207,8 +221,10 @@
"secret": "3KdPNBKZEyDGaNYK",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652738672
@ -234,8 +250,10 @@
"secret": "TBwbHJdJBQCpGdHi",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652738676
@ -261,8 +279,10 @@
"secret": "86pTYbQxxX3wd2FR",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652738773
@ -288,8 +308,10 @@
"secret": "FtxYcTM5p6B5GyPk",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652738872
@ -315,8 +337,10 @@
"secret": "5yHFHseBHDbCK3eZ",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652738972
@ -342,8 +366,10 @@
"secret": "pGC4z4TrbjZhii2m",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652739072
@ -369,8 +395,10 @@
"secret": "HMxT2rQ55bzeRNJx",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652739076
@ -396,8 +424,10 @@
"secret": "Z6yMp6D6mHKMjFi7",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652739174
@ -423,8 +453,10 @@
"secret": "Ek3ZjwPayCymDxhN",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652739272
@ -450,8 +482,10 @@
"secret": "NnnHaibdHJXMxNbC",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655652739372
@ -477,8 +511,10 @@
"secret": "bWkiEmY6wKM8WQP5",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false
},
@ -499,8 +535,10 @@
"subUid": [
"04c6722f-9a6d-40f3-ac9b-cd791b4c8933"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839933067
@ -537,8 +575,10 @@
"secret": "CN8ZGpcAheAbsDn2",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839933167
@ -558,8 +598,10 @@
"secret": "S4SDRKscRXAn43bc",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839933267
@ -585,8 +627,10 @@
"secret": "7N4S6eYzMCjA7YfK",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839933367
@ -606,8 +650,10 @@
"secret": "Jm7ecfyXawiend8K",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839933376
@ -633,8 +679,10 @@
"secret": "rtsZbST3tiJHccbe",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839933474
@ -660,8 +708,10 @@
"secret": "PXHwHXH4a8YJzZ3S",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839918667
@ -689,8 +739,10 @@
"secret": "BQj5SZetsC3eGtfM",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839918676
@ -718,8 +770,10 @@
"secret": "mbs4PsY4atEtzcA3",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839918771
@ -747,8 +801,10 @@
"secret": "4nrNrjnFMSQZB562",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839918871
@ -776,8 +832,10 @@
"secret": "Js66kBbXRjXmcpMB",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839918967
@ -799,8 +857,10 @@
"secret": "pGxKYrNJC7rDhsr8",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416485331
@ -820,8 +880,10 @@
"secret": "ZxDQeQ8jhMrfx8eE",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416485335
@ -841,8 +903,10 @@
"secret": "fEbdXEayedpBx6wk",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416485433
@ -862,8 +926,10 @@
"secret": "Crm28CTD6iw7hYw5",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416485531
@ -883,8 +949,10 @@
"secret": "FkCQGREXYCmjzxaZ",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655416485631
@ -904,8 +972,10 @@
"secret": "JwKxnDWGrRcP8xAJ",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839919567
@ -925,8 +995,10 @@
"secret": "xrX2mrkQwf3YYaWc",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839919576
@ -946,8 +1018,10 @@
"secret": "diRBkEREDt47MzWF",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839919673
@ -967,8 +1041,10 @@
"secret": "fR3R3i8BYDKWAiDj",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false
},
@ -984,8 +1060,10 @@
"secret": "t3NYS5p7ExYaWKx4",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false
},
@ -1001,8 +1079,10 @@
"secret": "KSpeRjXRP8H7tcAn",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false
},
@ -1018,8 +1098,10 @@
"secret": "DSBbhJW7cGXRWeZA",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839926671
@ -1039,8 +1121,10 @@
"secret": "5bm8pNYcdj7YPMXn",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839926777
@ -1060,8 +1144,10 @@
"secret": "neSfPnhsjCsQiCQx",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653839927067
@ -1081,8 +1167,10 @@
"secret": "2D2k8mmHbi2AMh8G",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653785231385
@ -1103,8 +1191,10 @@
"secret": "AQHQJTQ2iXkncb3C",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653785231786
@ -1125,8 +1215,10 @@
"secret": "PwYEKSARBJjD4y6B",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653785232184
@ -1147,8 +1239,10 @@
"secret": "C8YxCycFFeQDPKX4",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653730979070
@ -1170,8 +1264,10 @@
"parentId": "16514626212240aabbccee01000000143",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653380321483
@ -1195,8 +1291,10 @@
"model": "GW01",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1653185932725,
@ -1215,8 +1313,10 @@
"parentId": "16514626212240aabbccee01000000143",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653380322090,
@ -1238,8 +1338,10 @@
"parentId": "16514626212240aabbccee01000000143",
"uid": "15620886-b30d-439d-9e5f-13a094c1f1f9",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653380319984,
@ -1261,8 +1363,10 @@
"parentId": "16514626212240aabbccee01000000143",
"uid": "15620886-b30d-439d-9e5f-13a094c1f1f9",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653380317469,
@ -1282,8 +1386,10 @@
"deviceName": "AA:BB:CC:EE:01",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653380312358,
@ -1304,8 +1410,10 @@
"parentId": "165017126122400cefafcfee61000012b",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655415536433,
@ -1337,8 +1445,10 @@
"subUid": [
"04c6722f-9a6d-40f3-ac9b-cd791b4c8933"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1652602130873,
@ -1376,8 +1486,10 @@
"subUid": [
"04c6722f-9a6d-40f3-ac9b-cd791b4c8933"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1652602115884,
@ -1413,8 +1525,10 @@
"subUid": [
"629daa3de5a005209d182876"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655581924548,
@ -1448,8 +1562,10 @@
"subUid": [
"629daa3de5a005209d182876"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655581925148,
@ -1485,8 +1601,10 @@
"subUid": [
"629daa3de5a005209d182876"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655581925152,
@ -1522,8 +1640,10 @@
"subUid": [
"629daa3de5a005209d182876"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655581925157,
@ -1559,8 +1679,10 @@
"subUid": [
"629daa3de5a005209d182876"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655581925252,
@ -1596,8 +1718,10 @@
"subUid": [
"629daa3de5a005209d182876"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655581925255,
@ -1633,8 +1757,10 @@
"subUid": [
"629daa3de5a005209d182876"
],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1655581925247,
@ -1669,8 +1795,10 @@
"parentId": "16465226744430aabbccdd22000000143",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1653380311848,
@ -1693,8 +1821,10 @@
"parentId": "16465226744430aabbccdd22000000143",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1653380308883,
@ -1715,8 +1845,10 @@
"parentId": "16465226744430aabbccdd22000000143",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653729780071,
@ -1738,8 +1870,10 @@
"parentId": "16465226744430aabbccdd22000000143",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": true,
"onlineTime": 1653729780174,
@ -1759,8 +1893,10 @@
"deviceName": "AA:BB:CC:DD:22",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1653380299997,
@ -1777,8 +1913,10 @@
"deviceName": "123456789123",
"uid": "1",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1653380299997,
@ -1796,8 +1934,10 @@
"uid": "1",
"parentId": "168187356997901234567891230000120",
"subUid": [],
"longitude": "104.090377",
"latitude": "30.604218",
"locate":{
"longitude": "104.090377",
"latitude": "30.604218"
},
"state": {
"online": false,
"onlineTime": 1653380299997,

View File

@ -90,6 +90,12 @@ public class DeviceController {
return deviceServiceImpl.addDevice(bo.getData());
}
@ApiOperation(value = "保存设备")
@PostMapping("/save")
public boolean saveDevice(@RequestBody @Validated Request<DeviceInfoBo> bo) {
return deviceServiceImpl.saveDevice(bo.getData());
}
@ApiOperation(value = "获取子设备", notes = "获取子设备")
@PostMapping("/children/list")
public List<DeviceInfoVo> getChildren(@Validated @RequestBody PageRequest<String> request) {

View File

@ -20,6 +20,8 @@ public class DeviceInfoBo extends BaseDto {
private static final long serialVersionUID = -1L;
private String id;
@ApiModelProperty(value = "创建时间")
private Long createAt;
@ -63,7 +65,7 @@ public class DeviceInfoBo extends BaseDto {
@Size(max = 255, message = "设备状态长度不正确")
@AutoMapping(ignore = true)
@ReverseAutoMapping(ignore = true)
private String state;
private DeviceInfo.State state;
@ApiModelProperty(value = "用户id")
@Size(max = 255, message = "用户id长度不正确")

View File

@ -71,4 +71,6 @@ public interface IDeviceService {
boolean saveConfig(DeviceConfig data);
DeviceConfigVo getConfig(String deviceId);
boolean saveDevice(DeviceInfoBo data);
}

View File

@ -400,5 +400,13 @@ public class DeviceServiceImpl implements IDeviceService {
}
@Override
public boolean saveDevice(DeviceInfoBo data) {
DeviceInfo di=data.to(DeviceInfo.class);
di.setLocate(new DeviceInfo.Locate(data.getLongitude(),data.getLatitude()));
di.setState(data.getState());
return deviceInfoData.save(di)!=null;
}
}