diff --git a/opsli-modulars/opsli-modulars-test/pom.xml b/opsli-modulars/opsli-modulars-test/pom.xml
index 945261e..be302c7 100644
--- a/opsli-modulars/opsli-modulars-test/pom.xml
+++ b/opsli-modulars/opsli-modulars-test/pom.xml
@@ -19,5 +19,6 @@
org.opsliframework.boot
opsli-plugins-mail
+
\ No newline at end of file
diff --git a/opsli-modulars/opsli-modulars-test/src/main/java/org/opsli/modulars/test/web/TestRestController.java b/opsli-modulars/opsli-modulars-test/src/main/java/org/opsli/modulars/test/web/TestRestController.java
index eeed467..3c7da63 100644
--- a/opsli-modulars/opsli-modulars-test/src/main/java/org/opsli/modulars/test/web/TestRestController.java
+++ b/opsli-modulars/opsli-modulars-test/src/main/java/org/opsli/modulars/test/web/TestRestController.java
@@ -2,8 +2,11 @@ package org.opsli.modulars.test.web;
import org.opsli.common.api.ResultVo;
import org.opsli.common.base.concroller.BaseController;
-import org.opsli.plugins.mail.MailHandler;
+import org.opsli.core.cache.pushsub.msgs.DictMsgFactory;
+import org.opsli.plugins.mail.MailPlugin;
import org.opsli.plugins.mail.model.MailModel;
+import org.opsli.plugins.redis.RedisPlugin;
+import org.opsli.plugins.redis.pushsub.entity.BaseSubMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -21,7 +24,10 @@ import org.springframework.web.bind.annotation.RestController;
public class TestRestController extends BaseController {
@Autowired
- private MailHandler mailHandler;
+ private MailPlugin mailPlugin;
+
+ @Autowired
+ private RedisPlugin redisPlugin;
@GetMapping("/sendMail")
public ResultVo sendMail(){
@@ -29,8 +35,42 @@ public class TestRestController extends BaseController {
mailModel.setTo("meet.carina@foxmail.com");
mailModel.setSubject("测试邮件功能");
mailModel.setContent("
这是哪里呢?
lalalalalalallalalalalal!!!!");
- mailHandler.send(mailModel);
+ mailPlugin.send(mailModel);
return ResultVo.success("发送邮件成功!!!!!!");
}
+
+ /**
+ * 发送 Redis 订阅消息
+ * @return
+ */
+ @GetMapping("/sendMsg")
+ public ResultVo sendMsg(){
+
+ BaseSubMessage msg = DictMsgFactory.createMsg("test", "aaa", 123213);
+
+ boolean ret = redisPlugin.sendMessage(msg);
+ if(ret){
+ return ResultVo.success("发送订阅消息成功!!!!!!");
+ }
+ return ResultVo.error("发送订阅消息失败!!!!!!");
+ }
+
+
+ /**
+ * 发送 Redis 订阅消息
+ * @return
+ */
+ @GetMapping("/redisTest")
+ public ResultVo redisTest(){
+ boolean ret = redisPlugin.put("opsli:test", "12315");
+ if(ret){
+ Object o = redisPlugin.get("opsli:test");
+ ResultVo resultVo = new ResultVo();
+ resultVo.put("data",o);
+ return resultVo;
+ }
+ return ResultVo.error("发送订阅消息失败!!!!!!");
+ }
+
}
diff --git a/opsli-modulars/pom.xml b/opsli-modulars/pom.xml
index 32b32f2..ac97ea7 100644
--- a/opsli-modulars/pom.xml
+++ b/opsli-modulars/pom.xml
@@ -53,6 +53,13 @@
opsli-core
${project.parent.version}
+
+
+
+
+
+
+
\ No newline at end of file