发送邮件测试
This commit is contained in:
@ -20,7 +20,7 @@ import java.util.List;
|
|||||||
public class BizSendEmailVO {
|
public class BizSendEmailVO {
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "发送人标识")
|
@ApiModelProperty(value = "发送人标识(用户id)")
|
||||||
@NotEmpty(message = "发送人标识不能为空")
|
@NotEmpty(message = "发送人标识不能为空")
|
||||||
private String sendUid;
|
private String sendUid;
|
||||||
|
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.impl;
|
package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.impl;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.client.NotificationFeignClient;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.client.NotificationFeignClient;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.BizSendEmailVO;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.BizSendEmailVO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.BizSendMsgVO;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.BizSendMsgVO;
|
||||||
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.EshopMailPendingPO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.EshopSmsPendingPO;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.EshopSmsPendingPO;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.enums.ExceptionEnum;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.enums.ExceptionEnum;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSmsEmailService;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSmsEmailService;
|
||||||
@ -28,7 +31,6 @@ public class BizSmsEmailServiceImpl implements BizSmsEmailService {
|
|||||||
@Override
|
@Override
|
||||||
public Boolean sendMsg(BizSendMsgVO msgVO) {
|
public Boolean sendMsg(BizSendMsgVO msgVO) {
|
||||||
EshopSmsPendingPO po = new EshopSmsPendingPO();
|
EshopSmsPendingPO po = new EshopSmsPendingPO();
|
||||||
|
|
||||||
po.setSendCenter("ebtp");
|
po.setSendCenter("ebtp");
|
||||||
po.setSendModule("biz-service-ebtp-extend");
|
po.setSendModule("biz-service-ebtp-extend");
|
||||||
po.setSendUid(msgVO.getSendUid());
|
po.setSendUid(msgVO.getSendUid());
|
||||||
@ -39,16 +41,39 @@ public class BizSmsEmailServiceImpl implements BizSmsEmailService {
|
|||||||
po.setStrMobileNumber(msgVO.getStrMobileNumberr());
|
po.setStrMobileNumber(msgVO.getStrMobileNumberr());
|
||||||
}
|
}
|
||||||
po.setStrContent(msgVO.getStrContent());
|
po.setStrContent(msgVO.getStrContent());
|
||||||
logger.info("调用短信接口入参:[{}]", po);
|
logger.info("调用短信发送接口入参:[{}]", po);
|
||||||
BaseResponse baseResponse = notificationFeignClient.saveMsg(po);
|
BaseResponse baseResponse = notificationFeignClient.saveMsg(po);
|
||||||
ExceptionEnum.FRAME_EXCEPTION_SEND_MSG_FAIL.customValid(!baseResponse.isSuccess());
|
ExceptionEnum.FRAME_EXCEPTION_SEND_MSG_FAIL.customValid(!baseResponse.isSuccess());
|
||||||
logger.info("调用短信接口返回:[{}]", baseResponse.isSuccess());
|
logger.info("调用短信发送接口返回:[{}]", baseResponse.isSuccess());
|
||||||
|
|
||||||
return baseResponse.isSuccess();
|
return baseResponse.isSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean sendEmail(BizSendEmailVO emailVO) {
|
public Boolean sendEmail(BizSendEmailVO emailVO) {
|
||||||
return null;
|
EshopMailPendingPO po = new EshopMailPendingPO();
|
||||||
|
|
||||||
|
po.setSendCenter("ebtp");
|
||||||
|
po.setSendModule("biz-service-ebtp-extend");
|
||||||
|
po.setSendUid(emailVO.getSendUid());
|
||||||
|
po.setSendUname(emailVO.getSendUName());
|
||||||
|
if (emailVO.getSendToList() != null && !emailVO.getSendToList().isEmpty()) {
|
||||||
|
po.setSendTo(StringUtils.join(emailVO.getSendToList().toArray(), ","));
|
||||||
|
} else {
|
||||||
|
po.setSendTo(emailVO.getSendTo());
|
||||||
|
}
|
||||||
|
//邮件内容
|
||||||
|
po.setSubject(emailVO.getSubject());
|
||||||
|
po.setMsg(emailVO.getMsg());
|
||||||
|
po.setFileUrl("");
|
||||||
|
|
||||||
|
po.setFileType(emailVO.getFileType());
|
||||||
|
|
||||||
|
logger.info("调用邮件发送接口入参:[{}]", po);
|
||||||
|
BaseResponse baseResponse = notificationFeignClient.sendMail(po);
|
||||||
|
ExceptionEnum.FRAME_EXCEPTION_SEND_MSG_FAIL.customValid(!baseResponse.isSuccess());
|
||||||
|
logger.info("调用邮件发送接口返回:[{}]", baseResponse.isSuccess());
|
||||||
|
|
||||||
|
return baseResponse.isSuccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user