Mure 1 月之前
父节点
当前提交
14079ce5ee

+ 22 - 3
src/main/java/com/backendsys/modules/sdk/tencentcloud/ems/controller/TencentEmsController.java

@@ -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();

+ 1 - 1
src/main/resources/application-dev.yml

@@ -111,7 +111,7 @@ tencent:
     secret-key: EG5g3DLNCzd5MRK2XhhaGm7F9pKdikgT
     http-profile: ses.tencentcloudapi.com
     ses-client: ap-hongkong
-    from-email-address: 稻谷 <dev.noreply@mail.dgdrama.com>
+    from-email-address: 稻谷 <dev.noreply@mail.daogu.ai>
   sms:
     debug: false
     secret-id: AKIDITiApJZjt27AEOhzA92467Nbilw4RyRp

+ 1 - 1
src/main/resources/application-local.yml

@@ -113,7 +113,7 @@ tencent:
     secret-key: EG5g3DLNCzd5MRK2XhhaGm7F9pKdikgT
     http-profile: ses.tencentcloudapi.com
     ses-client: ap-hongkong
-    from-email-address: 稻谷 <dev.noreply@mail.dgdrama.com>
+    from-email-address: 稻谷 <dev.noreply@mail.daogu.ai>
   sms:
     debug: false
     secret-id: AKIDITiApJZjt27AEOhzA92467Nbilw4RyRp

+ 1 - 1
src/main/resources/application-prod.yml

@@ -112,7 +112,7 @@ tencent:
     secret-key: EG5g3DLNCzd5MRK2XhhaGm7F9pKdikgT
     http-profile: ses.tencentcloudapi.com
     ses-client: ap-hongkong
-    from-email-address: 稻谷 <noreply@mail.dgdrama.com>
+    from-email-address: 稻谷 <noreply@mail.daogu.ai>
   sms:
     debug: false
     secret-id: AKIDITiApJZjt27AEOhzA92467Nbilw4RyRp