This commit is contained in:
xiangwbs
2018-03-10 18:29:42 +08:00
parent b598c1ddb6
commit 4fad5dc3d9
2 changed files with 7 additions and 37 deletions
@@ -1,28 +0,0 @@
/*
* Copyright (C) 2016 Zhejiang DRORE Technology CO.,LTD.
* All rights reserved.
* Official Web Site: http://www.drore.com.
* Developer Web Site: http://open.drore.com.
*/
package com.xwbing.exception;
/**
* 说明: 用户系统中未登陆异常
* 项目名称: boot-module-demo
* 创建时间: 2017/5/10 16:36
* 作者: xiangwb
*/
public class UserNotLoginException extends RuntimeException {
private static final long serialVersionUID = -3173607918780955199L;
public UserNotLoginException() {
// TODO Auto-generated constructor stub
}
public UserNotLoginException(String msg) {
super(msg);
}
}
@@ -8,7 +8,6 @@ import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Iterator;
import java.util.Set;
/**
@@ -30,16 +29,15 @@ public class RedisStartupInit implements InitializingBean {
public void afterPropertiesSet() throws Exception {
logger.info("redis has been start");
System.out.println("启动执行方法======刷新缓存==================");
redisService.set("xwb", "测试数据");
System.out.printf(redisService.get("xwb"));
redisService.set("test", "插入数据成功");
logger.info("redis获取测试数据:{}",redisService.get("test"));
redisService.del("xwb");
System.out.printf(String.valueOf(redisService.exists("xwb")));
boolean exists = redisService.exists("xwb");
logger.info("redis测试成功:{}",!exists);
Set<String> set = redisService.keys(redisCode + "*");
Iterator<String> it = set.iterator();
while (it.hasNext()) {
String keyStr = it.next();
System.out.println("启动删除缓存名称==" + keyStr);
set.forEach(keyStr -> {
logger.info("删除缓存名称=={}",keyStr);
redisService.delInit(keyStr);
}
});
}
}