add 增加 资源服务 短信与邮件 远程接口实现

This commit is contained in:
疯狂的狮子li
2022-05-09 10:07:21 +08:00
parent 92d07f2bfc
commit 079b7c2455
5 changed files with 202 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package com.ruoyi.resource.api;
import com.ruoyi.common.core.exception.ServiceException;
import java.io.File;
import java.util.List;
/**
* 邮件服务
*
* @author Lion Li
*/
public interface RemoteMailService {
/**
* 发送邮件
*
* @param to 接收人
* @param subject 标题
* @param text 内容
*/
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;
}

View File

@@ -0,0 +1,25 @@
package com.ruoyi.resource.api;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.resource.api.domain.SysFile;
import com.ruoyi.resource.api.domain.SysSms;
import java.util.Map;
/**
* 短信服务
*
* @author Lion Li
*/
public interface RemoteSmsService {
/**
* 发送短信
*
* @param phones 电话号(多个逗号分割)
* @param templateId 模板id
* @param param 模板对应参数
*/
SysSms send(String phones, String templateId, Map<String, String> param) throws ServiceException;
}

View File

@@ -0,0 +1,32 @@
package com.ruoyi.resource.api.domain;
import lombok.Data;
import java.io.Serializable;
/**
* 文件信息
*
* @author ruoyi
*/
@Data
public class SysSms implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 是否成功
*/
private Boolean isSuccess;
/**
* 响应消息
*/
private String message;
/**
* 实际响应体
*/
private Object response;
}