|
|
|
@ -31,6 +31,8 @@ import org.springframework.web.client.RestTemplate;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -160,7 +162,6 @@ public class SyncController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONObject redirectNolog(HttpServletRequest request, String uri) {
|
|
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
HttpEntity<String> httpEntity = uriUtils.buildHeader(request);
|
|
|
|
@ -168,6 +169,7 @@ public class SyncController {
|
|
|
|
|
if (request.getMethod().equals("POST")) {
|
|
|
|
|
responseBody = restTemplate.postForEntity(uri, httpEntity, JSONObject.class);
|
|
|
|
|
} else if (request.getMethod().equals("GET")) {
|
|
|
|
|
uri = uri +"?"+ request.getQueryString();
|
|
|
|
|
responseBody = restTemplate.exchange(uri, HttpMethod.GET, httpEntity, JSONObject.class);
|
|
|
|
|
}
|
|
|
|
|
JSONObject result = responseBody.getBody();
|
|
|
|
@ -189,7 +191,7 @@ public class SyncController {
|
|
|
|
|
writeUploadLog(taskId, httpEntity.getBody(), idDatas, type);
|
|
|
|
|
responseBody = restTemplate.postForEntity(uri, httpEntity, JSONObject.class);
|
|
|
|
|
} else if (request.getMethod().equals("GET")) {
|
|
|
|
|
writeDownloadLog(taskId, httpEntity.getBody(), idDatas, type);
|
|
|
|
|
writeUploadLog(taskId, httpEntity.getBody(), idDatas, type);
|
|
|
|
|
responseBody = restTemplate.exchange(uri, HttpMethod.GET, httpEntity, JSONObject.class);
|
|
|
|
|
}
|
|
|
|
|
JSONObject result = responseBody.getBody();
|
|
|
|
@ -206,7 +208,7 @@ public class SyncController {
|
|
|
|
|
writeUploadLog(taskId, httpEntity.getBody(), idDatas, type);
|
|
|
|
|
responseBody = restTemplate.postForEntity(uri, httpEntity, JSONObject.class);
|
|
|
|
|
} else if (request.getMethod().equals("GET")) {
|
|
|
|
|
writeDownloadLog(taskId, httpEntity.getBody(), idDatas, type);
|
|
|
|
|
writeUploadLog(taskId, httpEntity.getBody(), idDatas, type);
|
|
|
|
|
responseBody = restTemplate.exchange(uri, HttpMethod.GET, httpEntity, JSONObject.class);
|
|
|
|
|
}
|
|
|
|
|
JSONObject result = responseBody.getBody();
|
|
|
|
|