yjj преди 1 година
родител
ревизия
0910eb22d0

+ 4 - 2
src/main/java/com/example/demo/demos/web/service/impl/EcsInfoServiceImpl.java

@@ -1,5 +1,6 @@
 package com.example.demo.demos.web.service.impl;
 
+import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -46,9 +47,10 @@ public class EcsInfoServiceImpl extends ServiceImpl<EcsInfoMapper, EcsInfo> impl
         if (!list.isEmpty()) {
             for (String number : Constants.SEND_MSG_NUMBER) {
                 list.forEach(i -> {
-                    String str  = "{\"name\": \""+i.getUrl()+"\"}";
+                    JSONObject entries = new JSONObject();
+                    entries.set("name",i.getUrl());
                     try {
-                        SMSUtil.sendMsg(number,"天目智能科技","SMS_475345133",str);
+                        SMSUtil.sendMsg(number,"天目智能科技","SMS_475345133",entries.toString());
                     } catch (Exception e) {
                         log.error("短信发送失败:{}",e);
                         throw new RuntimeException(e);

+ 1 - 1
src/main/java/com/example/demo/demos/web/util/SMSUtil.java

@@ -44,7 +44,7 @@ public class SMSUtil {
                 .setTemplateParam(param);
 
         SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest,new RuntimeOptions());
-        log.info("短信发送给:{}成功,返回结果是:{}", phoneNumber,sendSmsResponse);
+        log.info("短信发送给:{}成功,返回结果是:{}", phoneNumber,sendSmsResponse.body.message);
     }