Selaa lähdekoodia

调整

master
zouhantao 3 viikkoa sitten
vanhempi
commit
70c94670b9

+ 3
- 3
zhywpt-app-msgw/src/main/java/cn/com/taiji/msgw/dto/MessageSmsSendRequestDto.java Näytä tiedosto

@@ -21,9 +21,9 @@ import lombok.Setter;
@Setter
public class MessageSmsSendRequestDto extends AbstractStaffBizRequestDTO {

@ApiModelProperty(value = "客户端id", required = true)
@NotBlank
private String messageClientId;
@ApiModelProperty(value = "密钥id", required = true)
private String smsKeyId; // 密钥id
// 推送时间
@ApiModelProperty(value = "推送时间")
private LocalDateTime pushTime;

+ 11
- 1
zhywpt-app-msgw/src/main/java/cn/com/taiji/msgw/manager/smsSend/SmsManagerImpl.java Näytä tiedosto

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

Loading…
Peruuta
Tallenna