|
@@ -44,6 +44,7 @@ import com.google.common.collect.Lists;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.Data;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -88,6 +89,8 @@ public class IotStaticController {
|
|
|
private RestTemplate restTemplate;
|
|
|
@Autowired
|
|
|
private IotMaintainService iotMaintainService;
|
|
|
+ @Value("${yanfan.url}")
|
|
|
+ private String yanfanUrl;
|
|
|
|
|
|
@GetMapping("/main/day")
|
|
|
public CommonResult<Map<String, Object>> getMaintainDay() {
|
|
@@ -371,8 +374,7 @@ public class IotStaticController {
|
|
|
deviceHistoryParam.setBeginTime(beginTime);
|
|
|
deviceHistoryParam.setEndTime(endTime);
|
|
|
|
|
|
-// JSONObject jsonObject1 = restTemplate.postForObject("http://1.94.244.160:86/prod-api/login", ImmutableMap.of("username", "admin", "password", "123456"), JSONObject.class);
|
|
|
- JSONObject jsonObject = restTemplate.postForObject("http://1.94.244.160:86/prod-api/data/center/deviceHistory", deviceHistoryParam, JSONObject.class);
|
|
|
+ JSONObject jsonObject = restTemplate.postForObject(yanfanUrl + "/prod-api/data/center/deviceHistory", deviceHistoryParam, JSONObject.class);
|
|
|
JSONArray object = JSON.parseArray(JSON.toJSONString(jsonObject.get("data")));
|
|
|
|
|
|
return CommonResult.success(object);
|