Browse Source

redis整合

黄远 5 years ago
parent
commit
14ea027370

+ 26 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/framework/runner/SystemServiceRunner.java

@@ -0,0 +1,26 @@
+package cn.com.ty.lift.system.framework.runner;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author huangyuan
+ * @date 2019-12-03
+ * @description
+ */
+@Component
+@Slf4j
+public class SystemServiceRunner implements ApplicationRunner {
+
+    @Autowired
+    RedisTemplate redisTemplate;
+
+    @Override
+    public void run(ApplicationArguments args) throws Exception {
+
+    }
+}

+ 13 - 0
lift-system-service/src/main/resources/application.yml

@@ -20,6 +20,19 @@ spring:
     password: ms.c88pocY/
 
 
+  #redis缓存配置
+  redis:
+    database: 0 #数据库索引,默认为0
+    host: 132.232.206.88 #服务器地址
+    port: 6379 #端口
+    password: mdx12358 #验证密码
+    jedis:
+      pool:
+        max-active: 8 #最大连接数
+        max-idle: 8 #最大空闲链接
+        max-wait: 20000ms
+        min-idle: 0
+
 #自动添加createTime、isDelete 等字段
 xwy:
   mybatis: