Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
JAVA小学生-王铁柱
eladmin
提交
f9ff6d86
E
eladmin
项目概览
JAVA小学生-王铁柱
/
eladmin
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
eladmin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f9ff6d86
编写于
6月 04, 2019
作者:
Z
zhengjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
去除redis的新增编辑功能
上级
2b931a58
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
4 addition
and
44 deletion
+4
-44
eladmin-common/src/main/java/me/zhengjie/redis/RedisConfig.java
...n-common/src/main/java/me/zhengjie/redis/RedisConfig.java
+0
-2
eladmin-system/src/main/java/me/zhengjie/modules/monitor/rest/RedisController.java
...ava/me/zhengjie/modules/monitor/rest/RedisController.java
+0
-16
eladmin-system/src/main/java/me/zhengjie/modules/monitor/service/RedisService.java
...ava/me/zhengjie/modules/monitor/service/RedisService.java
+0
-6
eladmin-system/src/main/java/me/zhengjie/modules/monitor/service/impl/RedisServiceImpl.java
...engjie/modules/monitor/service/impl/RedisServiceImpl.java
+4
-7
pom.xml
pom.xml
+0
-13
未找到文件。
eladmin-common/src/main/java/me/zhengjie/redis/RedisConfig.java
浏览文件 @
f9ff6d86
...
...
@@ -19,8 +19,6 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.RedisSerializationContext
;
import
redis.clients.jedis.JedisPool
;
import
redis.clients.jedis.JedisPoolConfig
;
import
java.time.Duration
;
/**
...
...
eladmin-system/src/main/java/me/zhengjie/modules/monitor/rest/RedisController.java
浏览文件 @
f9ff6d86
...
...
@@ -29,22 +29,6 @@ public class RedisController {
return
new
ResponseEntity
(
redisService
.
findByKey
(
key
,
pageable
),
HttpStatus
.
OK
);
}
@Log
(
"新增Redis缓存"
)
@PostMapping
(
value
=
"/redis"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','REDIS_ALL','REDIS_CREATE')"
)
public
ResponseEntity
create
(
@Validated
@RequestBody
RedisVo
resources
){
redisService
.
save
(
resources
);
return
new
ResponseEntity
(
HttpStatus
.
CREATED
);
}
@Log
(
"修改Redis缓存"
)
@PutMapping
(
value
=
"/redis"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','REDIS_ALL','REDIS_EDIT')"
)
public
ResponseEntity
update
(
@Validated
@RequestBody
RedisVo
resources
){
redisService
.
save
(
resources
);
return
new
ResponseEntity
(
HttpStatus
.
NO_CONTENT
);
}
@Log
(
"删除Redis缓存"
)
@DeleteMapping
(
value
=
"/redis"
)
@PreAuthorize
(
"hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')"
)
...
...
eladmin-system/src/main/java/me/zhengjie/modules/monitor/service/RedisService.java
浏览文件 @
f9ff6d86
...
...
@@ -18,12 +18,6 @@ public interface RedisService {
*/
public
Page
findByKey
(
String
key
,
Pageable
pageable
);
/**
* create
* @param redisVo
*/
public
void
save
(
RedisVo
redisVo
);
/**
* delete
* @param key
...
...
eladmin-system/src/main/java/me/zhengjie/modules/monitor/service/impl/RedisServiceImpl.java
浏览文件 @
f9ff6d86
...
...
@@ -9,8 +9,6 @@ import org.springframework.data.domain.PageImpl;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
redis.clients.jedis.Jedis
;
import
redis.clients.jedis.JedisPool
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -31,6 +29,10 @@ public class RedisServiceImpl implements RedisService {
key
=
"*"
+
key
+
"*"
;
}
for
(
Object
s
:
redisTemplate
.
keys
(
key
))
{
// 过滤掉权限的缓存
if
(
s
.
toString
().
indexOf
(
"role::loadPermissionByUser"
)
!=
-
1
||
s
.
toString
().
indexOf
(
"user::loadUserByUsername"
)
!=
-
1
)
{
continue
;
}
RedisVo
redisVo
=
new
RedisVo
(
s
.
toString
(),
redisTemplate
.
opsForValue
().
get
(
s
.
toString
()).
toString
());
redisVos
.
add
(
redisVo
);
}
...
...
@@ -41,11 +43,6 @@ public class RedisServiceImpl implements RedisService {
return
page
;
}
@Override
public
void
save
(
RedisVo
redisVo
)
{
redisTemplate
.
opsForValue
().
set
(
redisVo
.
getKey
(),
redisVo
.
getValue
());
}
@Override
public
void
delete
(
String
key
)
{
redisTemplate
.
delete
(
key
);
...
...
pom.xml
浏览文件 @
f9ff6d86
...
...
@@ -73,13 +73,6 @@
</dependency>
<!--Spring boot end-->
<!--jedis-->
<dependency>
<groupId>
redis.clients
</groupId>
<artifactId>
jedis
</artifactId>
<version>
${jedis.version}
</version>
</dependency>
<!--spring2.0集成redis所需common-pool2-->
<dependency>
<groupId>
org.apache.commons
</groupId>
...
...
@@ -91,12 +84,6 @@
<artifactId>
commons-lang3
</artifactId>
</dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
<artifactId>
commons-beanutils
</artifactId>
<version>
1.9.3
</version>
</dependency>
<!--监控sql日志-->
<dependency>
<groupId>
org.bgee.log4jdbc-log4j2
</groupId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录