|
|
@@ -2,6 +2,7 @@ package cn.com.taiji.msgw.manager.smsSend; |
|
|
|
|
|
|
|
import cn.com.taiji.common.pub.json.JsonTools; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ias.message.HltSendShortRequest; |
|
|
|
import cn.com.taiji.core.repo.jpa.msgw.MsgwSmsKeyConfigRepo; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@@ -18,6 +19,8 @@ public class SmsManagerImpl extends AbstractCommManager implements SmsManager { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MessageImportManager importManager; |
|
|
|
@Autowired |
|
|
|
private MsgwSmsKeyConfigRepo smsKeyConfigRepo; |
|
|
|
|
|
|
|
@Override |
|
|
|
public MessageSmsSendResponseDto smsAdd(MessageSmsSendRequestDto request) throws ManagerException { |
|
|
@@ -25,7 +28,14 @@ public class SmsManagerImpl extends AbstractCommManager implements SmsManager { |
|
|
|
// 新增主表 |
|
|
|
MessageImportRequestDto importRequestDto = copyProperties(request, new MessageImportRequestDto()); |
|
|
|
HltSendShortRequest shortRequest = new HltSendShortRequest(); |
|
|
|
// todo 加个密钥校验 |
|
|
|
// 密钥校验 |
|
|
|
if (request.getSmsKeyId() != null){ |
|
|
|
if (smsKeyConfigRepo.findById(request.getSmsKeyId()).isEmpty()){ |
|
|
|
throw new ManagerException("密钥不存在"); |
|
|
|
}else { |
|
|
|
shortRequest.setSmsKeyId(request.getSmsKeyId()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 构建RequestDataJson |
|
|
|
shortRequest.setTitle(request.getTitle()); |
|
|
|
shortRequest.setMessage(request.getMessage()); |