From d937694a31415d25826d515cb4b6c77974c821fa Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期三, 27 三月 2024 10:42:04 +0800
Subject: [PATCH] 雷达在线注释掉
---
ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java | 81 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 77 insertions(+), 4 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java b/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
index b6391b0..8720596 100644
--- a/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
+++ b/ard-work/src/main/java/com/ruoyi/device/uav/service/UavService.java
@@ -82,14 +82,14 @@
}
private void getUavConfig() {
- /*this.host = ConfigUtils.getConfigValue("uav_host");
+ this.host = ConfigUtils.getConfigValue("uav_host");
this.username = ConfigUtils.getConfigValue("uav_username");
this.password = ConfigUtils.getConfigValue("uav_password");
- this.salt = ConfigUtils.getConfigValue("uav_salt");*/
- this.host = "http://112.98.126.2:6100/";
+ this.salt = ConfigUtils.getConfigValue("uav_salt");
+ /*this.host = "http://112.98.126.2:6100/";
this.username = "znstest";
this.password = "znstest";
- this.salt = "0123456789012345";
+ this.salt = "0123456789012345";*/
if (StringUtils.isEmpty(this.host) || StringUtils.isEmpty(this.username) || StringUtils.isEmpty(this.password) || StringUtils.isEmpty(this.salt)) {
throw new RuntimeException("鏃犱汉鏈哄弬鏁伴厤缃己澶�:");
}
@@ -744,4 +744,77 @@
return new HashMap();
}
}
+
+ public Object addAlarm(String url, Map<String,Object> data) {
+ String token = this.getToken();
+ url = this.host + url;
+ data.put("userName",this.username);
+ Map<String,Object> resultMap = addAlarm(url,token, data);
+ return resultMap;
+ }
+
+ public Map<String,Object> addAlarm(String url,String access_token,Map<String,Object> map){
+ MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
+ OkHttpClient okHttpClient = new OkHttpClient();
+
+ RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(map));
+
+ Request request = new Request.Builder().url(url).post(body).addHeader("x-auth-token",access_token).build();
+
+ Response response = null;
+ try {
+ response = okHttpClient.newCall(request).execute();
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ ResponseBody responseBody = response.body();
+
+ try {
+ String message = responseBody.string();// 鍝嶅簲浣�
+ Map<String,Object> map0 = (Map<String, Object>) JSON.parse(message);
+ return map0;
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return new HashMap();
+ }
+ }
+
+ public Object saveCurrentGroup(String url, Map<String,Object> data) {
+ String token = this.getToken();
+ url = this.host + url;
+ Map<String,Object> resultMap = addWaylinesPlanning(url,token, data);
+ return resultMap;
+ }
+
+ public Map<String,Object> saveCurrentGroup(String url,String access_token,Map<String,Object> map){
+ MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
+ OkHttpClient okHttpClient = new OkHttpClient();
+
+ RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(map));
+
+ Request request = new Request.Builder().url(url).post(body).addHeader("x-auth-token",access_token).build();
+
+ Response response = null;
+ try {
+ response = okHttpClient.newCall(request).execute();
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
+ ResponseBody responseBody = response.body();
+
+ try {
+ String message = responseBody.string();// 鍝嶅簲浣�
+ Map<String,Object> map0 = (Map<String, Object>) JSON.parse(message);
+ return map0;
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return new HashMap();
+ }
+ }
}
--
Gitblit v1.9.3