Commit cbefb499 authored by hongguangwu's avatar hongguangwu

1.7.21-临时文件延迟删除

parent 33193eb6
......@@ -17,8 +17,8 @@ import java.net.URI;
@Log4j2
public class HttpDaprUtil {
private static RestTemplate restTemplate;
private static HttpHeaders headers;
private static StringBuffer stringBuffer;
//private static HttpHeaders headers
//private static StringBuffer stringBuffer
/**
* @param appUrl
......@@ -39,7 +39,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
initResTemplate();
// 初始化请求URL
initUrl(appUrl, appId, method, param);
StringBuilder stringBuffer = initUrl(appUrl, appId, method, param);
ResponseEntity<T> res;
try {
res = restTemplate.getForEntity(stringBuffer.toString(), cs);
......@@ -73,7 +73,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
initResTemplate();
// 初始化请求URL
initUrl(appUrl, appId, method, param);
StringBuilder stringBuffer = initUrl(appUrl, appId, method, param);
ResponseEntity<T> res;
HttpHeaders headers = new HttpHeaders();
headers.add(SecurityConstants.FROM, from);
......@@ -101,7 +101,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
initResTemplate();
// 初始化请求URL
initUrl(appUrl, appId, method, "");
StringBuilder stringBuffer = initUrl(appUrl, appId, method, "");
ResponseEntity<T> res;
HttpHeaders headers = new HttpHeaders();
headers.add(SecurityConstants.FROM, from);
......@@ -136,13 +136,14 @@ public class HttpDaprUtil {
* @author fxj
* @date 2022/5/23 18:11
*/
private static void initUrl(String appUrl, String appId, String method, String param) {
stringBuffer = new StringBuffer();
private static StringBuilder initUrl(String appUrl, String appId, String method, String param) {
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(appUrl);
stringBuffer.append(appId);
stringBuffer.append("/method");
stringBuffer.append(method);
stringBuffer.append(param);
return stringBuffer;
}
public static <T> R<T> invokeMethodGetR(String appUrl,
......@@ -152,7 +153,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
initResTemplate();
// 初始化请求URL
initUrl(appUrl, appId, method, param);
StringBuilder stringBuffer = initUrl(appUrl, appId, method, param);
ResponseEntity<R> res;
try {
res = restTemplate.getForEntity(stringBuffer.toString(), R.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment