|
@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
@RestController
|
|
|
@Tag(name = "腾讯云-邮件回调")
|
|
|
public class TencentEmsController {
|
|
@@ -30,9 +32,24 @@ public class TencentEmsController {
|
|
|
@Anonymous
|
|
|
@Operation(summary = "邮件推送 (测试)")
|
|
|
@GetMapping("/api/ems/send")
|
|
|
- public Result receiveCallback(String email) {
|
|
|
+ public Result receiveCallback(Object body, HttpServletRequest request) {
|
|
|
+
|
|
|
+ // 再尝试输出一下:来源地址、URL参数、headers
|
|
|
+ System.out.println("===============================");
|
|
|
+ System.out.println("body参数: " + body);
|
|
|
+ System.out.println("===============================");
|
|
|
+ // 1. 打印所有请求头
|
|
|
+ request.getHeaderNames()
|
|
|
+ .asIterator()
|
|
|
+ .forEachRemaining(name -> {
|
|
|
+ String value = request.getHeader((String) name);
|
|
|
+ System.out.println(name + " : " + value);
|
|
|
+ });
|
|
|
+ System.out.println("===============================");
|
|
|
+
|
|
|
String templateParamSet = "{ \"code\": \"123456\", \"minute\": \"5\" }";
|
|
|
- return Result.success().put("data", tencentEmsService.send("邮件测试", 140698L, templateParamSet, email));
|
|
|
+ //return Result.success().put("data", tencentEmsService.send("邮件测试", 140698L, templateParamSet, email));
|
|
|
+ return Result.success().put("data", tencentEmsService.send("邮件测试", 140698L, templateParamSet, "405348097@qq.com"));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -45,7 +62,9 @@ public class TencentEmsController {
|
|
|
//public Result receiveCallback(@RequestBody List<TencentEmsCallbackNew> emsCallbackList) {
|
|
|
public Result receiveCallback(@RequestBody Object body) {
|
|
|
|
|
|
- System.out.println("body = " + body);
|
|
|
+ System.out.println("===============================");
|
|
|
+ System.out.println("body参数: " + body);
|
|
|
+ System.out.println("===============================");
|
|
|
|
|
|
// tencentEmsCallbackService.receiveCallback(emsCallbackList);
|
|
|
return Result.success();
|