Commit fedea83548f1d157bd13bb53b30dd1584e8d59f4
1 parent
d9411bea
Exists in
master
设备升级接口完成和完成配置部分接口
Showing
1 changed file
with
106 additions
and
1 deletions
Show diff stats
springboot/src/main/java/com/sincre/springboot/controller/Yinshi/DeviceControl.java
@@ -20,7 +20,7 @@ import java.util.Map; | @@ -20,7 +20,7 @@ import java.util.Map; | ||
20 | 20 | ||
21 | @RestController | 21 | @RestController |
22 | @RequestMapping("/YinShiDevice") | 22 | @RequestMapping("/YinShiDevice") |
23 | -@Api(tags = "设备管理部分接口—楼宇设备") | 23 | +@Api(tags = "设备管理部分接口—楼宇设备和客流统计") |
24 | public class DeviceControl { | 24 | public class DeviceControl { |
25 | 25 | ||
26 | 26 | ||
@@ -118,4 +118,109 @@ public class DeviceControl { | @@ -118,4 +118,109 @@ public class DeviceControl { | ||
118 | 118 | ||
119 | return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); | 119 | return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); |
120 | } | 120 | } |
121 | + | ||
122 | + | ||
123 | + | ||
124 | + @ApiOperation(value = "获取客流统计开关状态。") | ||
125 | + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true) | ||
126 | + @GetMapping("getCustomFlowCount") | ||
127 | + public ServerResponse getCustomFlowCount(@RequestParam String deviceSerial) { | ||
128 | + | ||
129 | + String url = YinShiServiceConfig.HostUrl + "lapp/passengerflow/switch/status"; | ||
130 | + Map<String, Object> map = new HashMap<>(); | ||
131 | + map.put("accessToken", YinShiServiceConfig.AccessToken); | ||
132 | + map.put("deviceSerial", deviceSerial); | ||
133 | + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map); | ||
134 | + | ||
135 | + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); | ||
136 | + | ||
137 | + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); | ||
138 | + } | ||
139 | + | ||
140 | + @ApiOperation(value = "查询用户下指定设备的版本信息。") | ||
141 | + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true) | ||
142 | + @GetMapping("getDeviceVersionInfo") | ||
143 | + public ServerResponse getDeviceVersionInfo(@RequestParam String deviceSerial) { | ||
144 | + | ||
145 | + String url = YinShiServiceConfig.HostUrl + "lapp/device/version/info"; | ||
146 | + Map<String, Object> map = new HashMap<>(); | ||
147 | + map.put("accessToken", YinShiServiceConfig.AccessToken); | ||
148 | + map.put("deviceSerial", deviceSerial); | ||
149 | + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map); | ||
150 | + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); | ||
151 | + | ||
152 | + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); | ||
153 | + } | ||
154 | + | ||
155 | + @ApiOperation(value = "升级设备固件至最新版本。") | ||
156 | + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true) | ||
157 | + @GetMapping("deviceUpgrade") | ||
158 | + public ServerResponse deviceUpgrade(@RequestParam String deviceSerial) { | ||
159 | + | ||
160 | + String url = YinShiServiceConfig.HostUrl + "lapp/device/upgrade"; | ||
161 | + Map<String, Object> map = new HashMap<>(); | ||
162 | + map.put("accessToken", YinShiServiceConfig.AccessToken); | ||
163 | + map.put("deviceSerial", deviceSerial); | ||
164 | + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map); | ||
165 | + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); | ||
166 | + | ||
167 | + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); | ||
168 | + } | ||
169 | + | ||
170 | + | ||
171 | + @ApiOperation(value = "查询用户下指定设备的升级状态,包括升级进度。") | ||
172 | + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true) | ||
173 | + @GetMapping("deviceUpgradeStatus") | ||
174 | + public ServerResponse deviceUpgradeStatus(@RequestParam String deviceSerial) { | ||
175 | + | ||
176 | + String url = YinShiServiceConfig.HostUrl + "lapp/device/upgrade/status"; | ||
177 | + Map<String, Object> map = new HashMap<>(); | ||
178 | + map.put("accessToken", YinShiServiceConfig.AccessToken); | ||
179 | + map.put("deviceSerial", deviceSerial); | ||
180 | + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map); | ||
181 | + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); | ||
182 | + | ||
183 | + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); | ||
184 | + } | ||
185 | + | ||
186 | + | ||
187 | + @ApiOperation(value = "对设备布撤防状态进行修改(活动检测开关),实现布防和撤防功能") | ||
188 | + @ApiImplicitParams({ | ||
189 | + @ApiImplicitParam(name = "deviceSerial", value = "设备序列号", required = true), | ||
190 | + @ApiImplicitParam(name = "isDefence",value = "具有防护能力设备布撤防状态:0-睡眠,8-在家,16-外出,普通IPC设备布撤防状态:`0-撤防,1-布防",required = true) | ||
191 | + }) | ||
192 | + @GetMapping("setDefenceStatus") | ||
193 | + public ServerResponse setDefenceStatus(@RequestParam String deviceSerial,@RequestParam Integer isDefence) { | ||
194 | + | ||
195 | + String url = YinShiServiceConfig.HostUrl + "lapp/device/defence/set"; | ||
196 | + Map<String, Object> map = new HashMap<>(); | ||
197 | + map.put("accessToken", YinShiServiceConfig.AccessToken); | ||
198 | + map.put("deviceSerial", deviceSerial); | ||
199 | + map.put("isDefence",isDefence); | ||
200 | + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map); | ||
201 | + | ||
202 | + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); | ||
203 | + | ||
204 | + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); | ||
205 | + } | ||
206 | + | ||
207 | + @ApiOperation(value = "根据设备验证码关闭设备视频加密开关") | ||
208 | + @ApiImplicitParams({ | ||
209 | + @ApiImplicitParam(name = "deviceSerial", value = "设备序列号", required = true), | ||
210 | + @ApiImplicitParam(name = "validateCode",value = "设备验证码,设备机身上的六位大写字母OLZKQU",required = true) | ||
211 | + }) | ||
212 | + @GetMapping("deviceVideoEncryptOff") | ||
213 | + public ServerResponse deviceVideoEncryptOff(@RequestParam String deviceSerial,@RequestParam String validateCode) { | ||
214 | + | ||
215 | + String url = YinShiServiceConfig.HostUrl + "lapp/device/encrypt/off"; | ||
216 | + Map<String, Object> map = new HashMap<>(); | ||
217 | + map.put("accessToken", YinShiServiceConfig.AccessToken); | ||
218 | + map.put("deviceSerial", deviceSerial); | ||
219 | + map.put("validateCode",validateCode); | ||
220 | + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map); | ||
221 | + | ||
222 | + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class); | ||
223 | + | ||
224 | + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); | ||
225 | + } | ||
121 | } | 226 | } |