From ca411580fc4002cc6d4666fb814666d31b759963 Mon Sep 17 00:00:00 2001 From: tyty Date: Fri, 26 May 2023 10:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9B=86=E4=B8=AD=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E6=8E=A8=E9=80=81=E7=9B=B8=E5=85=B3=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/service/impl/SmsMessageServiceImpl.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java index 65ccdf0..73927f5 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/SmsMessageServiceImpl.java @@ -2,12 +2,11 @@ package com.hnac.hzims.message.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.google.api.client.util.Value; import com.hnac.hzims.message.MessageConstants; -import com.hnac.hzims.message.entity.MessagePushRecordEntity; -import com.hnac.hzims.message.log.aspect.SaveLog; import com.hnac.hzims.message.dto.PushDto; import com.hnac.hzims.message.dto.SmsPushDto; +import com.hnac.hzims.message.entity.MessagePushRecordEntity; +import com.hnac.hzims.message.log.aspect.SaveLog; import com.hnac.hzims.message.service.IMessageService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -19,6 +18,7 @@ import org.springblade.core.tool.utils.Func; import org.springblade.resource.feign.ISmsClient; import org.springframework.stereotype.Service; import org.springframework.util.Assert; +import org.springframework.util.ObjectUtils; /** * @author hx @@ -54,9 +54,16 @@ public class SmsMessageServiceImpl implements IMessageService { request.getSmsParam(), this.getAccountByPusher(Long.parseLong(request.getPusher()),request.getType()) ); - Assert.isTrue(response.isSuccess(),() -> { - throw new ServiceException(response.getMsg()); - }); - return response.getData().isSuccess(); + if(ObjectUtils.isEmpty(response.getData())) { + Assert.isTrue(response.isSuccess(), () -> { + throw new ServiceException(response.getMsg()); + }); + return response.isSuccess(); + }else { + Assert.isTrue(response.getData().isSuccess(), () -> { + throw new ServiceException(response.getMsg()); + }); + return response.getData().isSuccess(); + } } }