|
@@ -18,15 +18,16 @@ import com.huimv.admin.entity.zengxindto.*;
|
|
|
import com.huimv.admin.service.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
-import org.springframework.http.HttpEntity;
|
|
|
-import org.springframework.http.HttpHeaders;
|
|
|
-import org.springframework.http.HttpMethod;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.http.*;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
+import java.lang.invoke.MethodHandleProxies;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.LocalTime;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -80,4 +81,23 @@ public class CarmeraTimer {
|
|
|
System.out.println(" ====== getCameras请求返回结果:【{" + data + "}】");
|
|
|
return data;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ RestTemplate restTemplate = new RestTemplate();
|
|
|
+ String envUrl = "https://dnqyt.envchina.com/api/public/station-data";
|
|
|
+ LocalDate previousDay = LocalDate.now().minusDays(1);
|
|
|
+ LocalDateTime previousDayStart = LocalDateTime.of(previousDay, LocalTime.MIN);
|
|
|
+
|
|
|
+ String sgToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJkYW9ub25nIiwidWlkIjozLCJ1biI6IlpYUUxZWktKMjMwN0EyIiwiZXhwIjoxNjg5MDcwNTYxLCJqdGkiOiIzIn0.BEFESZrKOwBej4rxOfoj7qPcHGomh6KN7xbXdjOB__w";
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.add("token",sgToken);
|
|
|
+ headers.setContentType(MediaType.APPLICATION_JSON);
|
|
|
+ HttpEntity<Map<String, Object>> formEntity = new HttpEntity<Map<String, Object>>(headers);
|
|
|
+
|
|
|
+ String urlWithParams = envUrl + "?type=D&mn=33330424001391" + "&startTime=" + "2023-07-10 00:00:00" + "&endTime=" + "2023-07-10 00:00:00";
|
|
|
+ ResponseEntity<String> result = restTemplate.exchange(urlWithParams, HttpMethod.GET,formEntity,String.class);
|
|
|
+ System.out.println(result);
|
|
|
+ }
|
|
|
+
|
|
|
}
|