| | |
| | | package com.dy.pipIrrMwTestWeb.rtuLog; |
| | | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.*; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | response = restTemplate.exchange(fullUrl, HttpMethod.GET, httpEntity, BaseResponse.class); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return BaseResponseUtils.buildError("后端系统出错,中间件调用异常"); |
| | | } |
| | | if(response == null){ |
| | | return BaseResponseUtils.buildError("后端系统出错,中间件调用异常"); |
| | | }else{ |
| | | return response.getBody(); |
| | | } |
| | | } |
| | | } |