添加远程调用日志

This commit is contained in:
wanjia 2023-03-30 09:16:59 +08:00
parent a7998050ae
commit 7bb0740694
1 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,8 @@ package com.gitlink.softbot.utils;
import com.gitlink.softbot.global.vo.Response;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
@ -16,7 +18,7 @@ import java.util.Objects;
public class RestTemplateUtil {
//private static Logger logger = (Logger) LoggerFactory.getLogger(RestTemplateUtil.class);
private static Logger logger = (Logger) LoggerFactory.getLogger(RestTemplateUtil.class);
/**
* @Description 私有构造函数
*/
@ -83,7 +85,7 @@ public class RestTemplateUtil {
params.setAll(inputParams);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url);
URI uri = builder.queryParams(params).build().encode().toUri();
//System.out.println(uri);
logger.info("远程接口调用地址: " + url);
ResponseEntity<String> resp = customRestTemplate.exchange(uri, method, entity, String.class);
return handleResult(resp);
}