update 优化 移除不合理的方法 携带附件的邮件建议直接集成插件发送
parent
ef2294a9c4
commit
b0dac358f7
|
|
@ -2,9 +2,6 @@ package org.dromara.resource.api;
|
|||
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 邮件服务
|
||||
*
|
||||
|
|
@ -21,14 +18,4 @@ public interface RemoteMailService {
|
|||
*/
|
||||
void send(String to, String subject, String text) throws ServiceException;
|
||||
|
||||
/**
|
||||
* 发送邮件带附件
|
||||
*
|
||||
* @param to 接收人
|
||||
* @param subject 标题
|
||||
* @param text 内容
|
||||
* @param fileList 附件
|
||||
*/
|
||||
void sendWithAttachment(String to, String subject, String text, List<File> fileList) throws ServiceException;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
package org.dromara.resource.dubbo;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.mail.utils.MailUtils;
|
||||
import org.dromara.resource.api.RemoteMailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.mail.utils.MailUtils;
|
||||
import org.dromara.resource.api.RemoteMailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 邮件服务
|
||||
*
|
||||
|
|
@ -34,16 +30,4 @@ public class RemoteMailServiceImpl implements RemoteMailService {
|
|||
MailUtils.sendText(to, subject, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮件带附件
|
||||
*
|
||||
* @param to 接收人
|
||||
* @param subject 标题
|
||||
* @param text 内容
|
||||
* @param fileList 附件
|
||||
*/
|
||||
public void sendWithAttachment(String to, String subject, String text, List<File> fileList) throws ServiceException {
|
||||
MailUtils.sendText(to, subject, text, ArrayUtil.toArray(fileList, File.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue