|
@@ -233,7 +233,9 @@ public class TencentWeComController {
|
|
|
@PostMapping("/send/post")
|
|
|
public String sendPost(@RequestBody SendRequestParam sendRequestParam) throws IOException {
|
|
|
log.info("sendPost sendRequestParam={}", sendRequestParam);
|
|
|
- return httpPoolClient.post(sendRequestParam.getUrl(), sendRequestParam.getParam());
|
|
|
+ String res = httpPoolClient.post(sendRequestParam.getUrl(), sendRequestParam.getParam());
|
|
|
+ log.info("sendPost sendRequestParam={}, res={}", sendRequestParam, res);
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
@GetMapping("/send/post/file")
|
|
@@ -244,7 +246,7 @@ public class TencentWeComController {
|
|
|
byte[] coverDecodedBytes = Base64.getDecoder().decode(cover);
|
|
|
String targetCover = new String(coverDecodedBytes);
|
|
|
|
|
|
-
|
|
|
+ log.info("sendPostFile url={},cover={}", targetUrl, targetCover);
|
|
|
String filePath = UUID.randomUUID() + ".jpg"; // 临时文件路径
|
|
|
HttpURLConnection httpUrl = (HttpURLConnection) new URL(targetCover).openConnection();
|
|
|
httpUrl.connect();
|
|
@@ -262,7 +264,7 @@ public class TencentWeComController {
|
|
|
httpUrl.disconnect();
|
|
|
File file = new File(filePath);
|
|
|
String res = httpPoolClient.post(targetUrl, file);
|
|
|
- log.info("sendPostFile res={}", res);
|
|
|
+ log.info("sendPostFile url={},cover={},res={}", targetUrl, targetCover, res);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
@@ -271,6 +273,8 @@ public class TencentWeComController {
|
|
|
byte[] decodedBytes = Base64.getDecoder().decode(url);
|
|
|
String originalString = new String(decodedBytes);
|
|
|
log.info("sendGet url={}", originalString);
|
|
|
- return httpPoolClient.get(originalString);
|
|
|
+ String res = httpPoolClient.get(originalString);
|
|
|
+ log.info("sendGet url={} res={}", originalString, res);
|
|
|
+ return res;
|
|
|
}
|
|
|
}
|