From 62581fdbaa1295b45c6b44377910554dbe61c3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=BA=AA=E6=9C=AB=E7=9A=84=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=B8=88?= <1072876976@qq.com> Date: Fri, 14 Jul 2023 16:16:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E5=89=8D=E7=AB=AF=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=BC=93=E5=AD=98=E7=AE=A1=E7=90=86=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E4=B8=AD=E5=86=97=E4=BD=99=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E4=B8=8E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/src/views/monitor/cache/index.vue | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/blog-vue/admin/src/views/monitor/cache/index.vue b/blog-vue/admin/src/views/monitor/cache/index.vue index 846d614d..d17f13a8 100644 --- a/blog-vue/admin/src/views/monitor/cache/index.vue +++ b/blog-vue/admin/src/views/monitor/cache/index.vue @@ -26,7 +26,7 @@ - + @@ -138,8 +138,8 @@ export default { // 缓存值 cacheValue: undefined }, - // 当前选中缓存类型 - cacheType: undefined + // 当前选中缓存名称 + cacheName: undefined } }, @@ -156,7 +156,6 @@ export default { // 打开加载框 this.typeLoading = true listCacheType().then((res) => { - console.log(res) this.cacheTypes = res // 关闭加载框 this.typeLoading = false @@ -167,14 +166,14 @@ export default { }, // 刷新Redis缓存键类型 refreshCacheTypes () { - // 重新获取缓存类型 + // 重新获取缓存名称 this.listCacheType() // 输出提示信息 - this.$message.success('缓存类型刷新成功') + this.$message.success('缓存名称刷新成功') }, // 刷新Redis缓存键 refreshCacheKeys () { - // 重新获取缓存类型 + // 重新获取缓存名称 this.getCacheKeys() // 输出提示信息 this.$message.success('缓存键刷新成功') @@ -182,13 +181,13 @@ export default { // 获取对应缓存键列表 getCacheKeys (row) { // 获取当前选中类型 - const cacheType = row !== undefined ? row.type : this.cacheType + const cacheName = row !== undefined ? row.name : this.cacheName // 加载框 this.keyLoading = true - listCacheKeys(cacheType).then((res) => { + listCacheKeys(cacheName).then((res) => { this.cacheKeys = res - // 赋值当前选中缓存类型 - this.cacheType = cacheType + // 赋值当前选中缓存名称 + this.cacheName = cacheName // 关闭加载框 this.keyLoading = false }).catch(() => { @@ -211,7 +210,7 @@ export default { }, // 去除掉缓存键名后的冒号 nameFormatter (row) { - return row.type.replace(':', '') + return row.name.replace(':', '') } } } -- Gitee From a2c959b2219a26f555bb835a94e2dfc5f458073b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=BA=AA=E6=9C=AB=E7=9A=84=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=B8=88?= <1072876976@qq.com> Date: Fri, 14 Jul 2023 16:44:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=B3=A8=E8=A7=A3=E5=B8=B8=E9=87=8F=EF=BC=8C?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=B3=A8=E8=A7=A3=E5=8F=82=E6=95=B0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../annotation/OperateLogAnnotation.java | 4 ++- .../common/constant/AnnotationConst.java | 36 +++++++++++++++++++ .../controller/monitor/OnlineController.java | 3 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 blog-springboot/blog-common/src/main/java/com/zrkizzy/common/constant/AnnotationConst.java diff --git a/blog-springboot/blog-common/src/main/java/com/zrkizzy/common/annotation/OperateLogAnnotation.java b/blog-springboot/blog-common/src/main/java/com/zrkizzy/common/annotation/OperateLogAnnotation.java index 90b6b601..bd373e6e 100644 --- a/blog-springboot/blog-common/src/main/java/com/zrkizzy/common/annotation/OperateLogAnnotation.java +++ b/blog-springboot/blog-common/src/main/java/com/zrkizzy/common/annotation/OperateLogAnnotation.java @@ -1,5 +1,7 @@ package com.zrkizzy.common.annotation; +import com.zrkizzy.common.constant.AnnotationConst; + import java.lang.annotation.*; /** @@ -16,6 +18,6 @@ public @interface OperateLogAnnotation { /** * 操作类型 0 其他操作,1 新增,2 修改, 3 删除, 4 查询 */ - String type() default "4"; + String type() default AnnotationConst.QUERY; } diff --git a/blog-springboot/blog-common/src/main/java/com/zrkizzy/common/constant/AnnotationConst.java b/blog-springboot/blog-common/src/main/java/com/zrkizzy/common/constant/AnnotationConst.java new file mode 100644 index 00000000..1525379b --- /dev/null +++ b/blog-springboot/blog-common/src/main/java/com/zrkizzy/common/constant/AnnotationConst.java @@ -0,0 +1,36 @@ +package com.zrkizzy.common.constant; + +/** + * 自定义注解全局常量 + * + * @author zhangrongkang + * @since 2023/7/14 + */ +public class AnnotationConst { + + /** + * 其他操作 + */ + public static final String OTHER = "0"; + + /** + * 新增操作 + */ + public static final String ADD ="1"; + + /** + * 修改操作 + */ + public static final String UPDATE = "2"; + + /** + * 删除操作 + */ + public static final String DELETE = "3"; + + /** + * 查询操作 + */ + public static final String QUERY = "4"; + +} diff --git a/blog-springboot/blog-web/src/main/java/com/zrkizzy/web/controller/monitor/OnlineController.java b/blog-springboot/blog-web/src/main/java/com/zrkizzy/web/controller/monitor/OnlineController.java index c21b66fa..d82d7df9 100644 --- a/blog-springboot/blog-web/src/main/java/com/zrkizzy/web/controller/monitor/OnlineController.java +++ b/blog-springboot/blog-web/src/main/java/com/zrkizzy/web/controller/monitor/OnlineController.java @@ -3,6 +3,7 @@ package com.zrkizzy.web.controller.monitor; import com.zrkizzy.common.annotation.OperateLogAnnotation; import com.zrkizzy.common.base.response.PageResult; import com.zrkizzy.common.base.response.Result; +import com.zrkizzy.common.constant.AnnotationConst; import com.zrkizzy.common.service.IRedisService; import com.zrkizzy.data.query.monitor.OnlineQuery; import com.zrkizzy.data.vo.monitor.OnlineUserVO; @@ -37,7 +38,7 @@ public class OnlineController { } @ApiOperation("下线指定用户") - @OperateLogAnnotation(type = "3") + @OperateLogAnnotation(type = AnnotationConst.DELETE) @DeleteMapping("/offline/{track}") public Result offlineUser(@PathVariable String track) { // 下线指定用户 -- Gitee From 4cec0609e4c2405f32ebe9bfdfcd036dd0496dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=BA=AA=E6=9C=AB=E7=9A=84=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=B8=88?= <1072876976@qq.com> Date: Fri, 14 Jul 2023 17:46:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=89=8D=E7=AB=AF=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog-vue/admin/src/views/monitor/cache/index.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/blog-vue/admin/src/views/monitor/cache/index.vue b/blog-vue/admin/src/views/monitor/cache/index.vue index d17f13a8..eae676c2 100644 --- a/blog-vue/admin/src/views/monitor/cache/index.vue +++ b/blog-vue/admin/src/views/monitor/cache/index.vue @@ -60,9 +60,8 @@ - -