| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.ruoyi.common.utils.JsonUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.sms.config.properties.SmsProperties; |
| | | import com.ruoyi.sms.entity.SmsResult; |
| | |
| | | this.client = new SmsClient(credential, "", clientProfile); |
| | | } |
| | | |
| | | @Override |
| | | public SmsResult send(String phones, String templateId, Map<String, String> param) { |
| | | if (StringUtils.isBlank(phones)) { |
| | | throw new SmsException("手机号不能为空"); |
| | |
| | | SmsResult.SmsResultBuilder builder = SmsResult.builder() |
| | | .isSuccess(true) |
| | | .message("send success") |
| | | .response(resp); |
| | | .response(JsonUtils.toJsonString(resp)); |
| | | for (SendStatus sendStatus : resp.getSendStatusSet()) { |
| | | if (!"Ok".equals(sendStatus.getCode())) { |
| | | builder.isSuccess(false).message(sendStatus.getMessage()); |