- 添加短信 单个,批量发送

This commit is contained in:
sin
2019-05-19 16:24:33 +08:00
parent 7905541501
commit 6dc432d49c
7 changed files with 241 additions and 7 deletions

View File

@@ -3,6 +3,8 @@ package cn.iocoder.mall.admin.api;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
/**
* 短信平台
*
@@ -81,4 +83,34 @@ public interface SmsPlatform {
* @return
*/
Result deleteTemplate(String tplId);
@Data
@Accessors(chain = true)
class SendResult {
private Boolean hasSuccess;
private Integer code;
private String message;
private List<String> success;
private List<String> fail;
}
/**
* 短信发送 - 单个
*
* @return
*/
SendResult singleSend(String mobile, String template);
/**
* 短信发送 - 批量
*
* @return
*/
SendResult batchSend(List<String> mobileList, String template);
}

View File

@@ -3,6 +3,8 @@ package cn.iocoder.mall.admin.api;
import cn.iocoder.mall.admin.api.bo.sms.SmsSignBO;
import cn.iocoder.mall.admin.api.bo.sms.SmsTemplateBO;
import java.util.List;
/**
* 短信服务
*
@@ -11,6 +13,8 @@ import cn.iocoder.mall.admin.api.bo.sms.SmsTemplateBO;
*/
public interface SmsService {
/**
* 签名 - 创建
*
@@ -64,4 +68,19 @@ public interface SmsService {
* @param id
*/
void deleteTemplate(Integer id);
/**
* 短信发送 - 单个
*
* @return
*/
void singleSend(String mobile, Integer smsTemplateId);
/**
* 短信发送 - 批量
*
* @return
*/
void batchSend(List<String> mobileList, Integer smsTemplateId);
}

View File

@@ -0,0 +1,53 @@
package cn.iocoder.mall.admin.api.bo.sms;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
*
*
* @author Sin
* @time 2019/5/19 4:23 PM
*/
public class SmsPage implements IPage {
@Override
public List getRecords() {
return null;
}
@Override
public IPage setRecords(List records) {
return null;
}
@Override
public long getTotal() {
return 0;
}
@Override
public IPage setTotal(long total) {
return null;
}
@Override
public long getSize() {
return 0;
}
@Override
public IPage setSize(long size) {
return null;
}
@Override
public long getCurrent() {
return 0;
}
@Override
public IPage setCurrent(long current) {
return null;
}
}

View File

@@ -51,7 +51,7 @@ public enum AdminErrorCodeEnum {
DATA_DICT_NOT_EXISTS(1002005001, "该数据字典不存在"),
// ========== 短信模板 1002006000 ==========
SMS_PLATFORM_FAIL(1002006000, "短信模板添加失败"),
SMS_PLATFORM_FAIL(1002006000, "短信平台调用失败【具体错误会动态替换】"),
SMS_SIGN_NOT_EXISTENT(1002006001, "短信签名不存在"),
SMS_SIGN_IS_EXISTENT(1002006002, "短信签名已存在"),
SMS_TEMPLATE_NOT_EXISTENT(1002006020, "短信签名不存在"),