MessageSenderPlugin.java 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package com.keao.edu.thirdparty.message;
  2. import java.io.IOException;
  3. public interface MessageSenderPlugin {
  4. /**
  5. * 发送方名称
  6. * @return
  7. */
  8. public String getName();
  9. /**
  10. * 发送模式(SMS/PUSH/EMAIL)
  11. * @return
  12. */
  13. public SendMode getSendMode();
  14. /**
  15. * 发送消息至目的地
  16. * @param subject 消息主题
  17. * @param content 消息内容
  18. * @param receiver 收件人
  19. * @param url 链接地址
  20. * @param appClient app客户端名称
  21. * @return 是否发送成功
  22. * @throws IOException
  23. */
  24. public boolean send(String subject, String content, String receiver, String url, String appClient) throws Exception;
  25. /**
  26. * 批量发送消息至目的地
  27. * @param subject 消息主题
  28. * @param content 消息内容
  29. * @param receivers 收件人列表
  30. * @param url 链接地址
  31. * @param jpushType 极光应用类型
  32. * @return 是否发送成功
  33. * @throws IOException
  34. */
  35. public boolean batchSend(String subject, String content, String[] receivers, String url, String jpushType) throws Exception;
  36. }