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 90b6b601718ce48f831619dad82e1cb169f8e993..bd373e6e33a8c4ff8b3dbc17e380629e5336d17e 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 0000000000000000000000000000000000000000..1525379b4362ef5b567eee63c1e2b1740c2341b5 --- /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 c21b66facff65e9c76df263978b637071d30a888..d82d7df96e0788e6391288c0e017101d8e55a82f 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) { // 下线指定用户 diff --git a/blog-vue/admin/src/views/monitor/cache/index.vue b/blog-vue/admin/src/views/monitor/cache/index.vue index 846d614d60b0a06624bfc34180611c854edc81c2..eae676c2e0ed06ce5b40daee3122d29e77a94380 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 @@ - + @@ -60,9 +60,8 @@ - -