ソースを参照

feat: add tree_log.sql

Chen YZ 5 年 前
コミット
b4704c7127

+ 1 - 2
web/src/main/java/seecoder/devcloud/web/aop/TreeLogging.java

@@ -6,12 +6,11 @@ import java.lang.annotation.*;
 
 /**
  * 以注解方式标记日志插入
+ * 要求:参数里带有TreeNodeVO
  */
 @Target({ElementType.PARAMETER, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 public @interface TreeLogging {
-
     public OperationEnum value();
-
 }

+ 1 - 1
web/src/main/java/seecoder/devcloud/web/aspect/TreeLoggingAspect.java

@@ -64,10 +64,10 @@ public class TreeLoggingAspect {
 //                    TODO:从session中获取userId和userName
                     log.setTime(sf.format(new Date()));
                     System.out.println(log);
+                    treeLogMapper.insertTreeLog(log);
                     break;
                 }
             }
-            treeLogMapper.insertTreeLog(log);
         }
     }
 }

+ 38 - 0
web/src/main/resources/SQLScripts/tree_log.sql

@@ -0,0 +1,38 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : localhost_3306
+ Source Server Type    : MySQL
+ Source Server Version : 80018
+ Source Host           : localhost:3306
+ Source Schema         : seecoder
+
+ Target Server Type    : MySQL
+ Target Server Version : 80018
+ File Encoding         : 65001
+
+ Date: 11/03/2021 09:46:42
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for tree_log
+-- ----------------------------
+DROP TABLE IF EXISTS `tree_log`;
+CREATE TABLE `tree_log`  (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `time` datetime(0) NULL DEFAULT NULL,
+  `operation` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+  `user_id` int(11) NULL DEFAULT NULL,
+  `tree_id` int(11) NULL DEFAULT NULL,
+  `user_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+-- ----------------------------
+-- Records of tree_log
+-- ----------------------------
+
+SET FOREIGN_KEY_CHECKS = 1;