diff --git a/pom.xml b/pom.xml
index c9019d7..d07fc0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,6 +21,20 @@
org.springframework.boot
spring-boot-starter-web
+
+ org.springframework.boot
+ spring-boot-starter-test
+
+
+ org.mybatis.spring.boot
+ mybatis-spring-boot-starter
+ 3.0.2
+
+
+ com.mysql
+ mysql-connector-j
+ runtime
+
org.projectlombok
@@ -28,10 +42,15 @@
true
- org.springframework.boot
- spring-boot-starter-test
- test
+ org.jetbrains
+ annotations
+ 23.0.0
+ compile
+
diff --git a/src/main/java/com/wxjw/common/Result.java b/src/main/java/com/wxjw/common/Result.java
new file mode 100644
index 0000000..e3462aa
--- /dev/null
+++ b/src/main/java/com/wxjw/common/Result.java
@@ -0,0 +1,18 @@
+package com.wxjw.common;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * @author 筱锋xiao_lfeng
+ */
+@Data
+@AllArgsConstructor
+public class Result {
+ private int code;
+ private T data;
+ private String msg;
+
+ public Result() {
+ }
+}
diff --git a/src/main/java/com/wxjw/controller/openapi/GetFileTreeController.java b/src/main/java/com/wxjw/controller/openapi/GetFileTreeController.java
new file mode 100644
index 0000000..b1666ab
--- /dev/null
+++ b/src/main/java/com/wxjw/controller/openapi/GetFileTreeController.java
@@ -0,0 +1,37 @@
+package com.wxjw.controller.openapi;
+
+import com.wxjw.common.Result;
+import com.wxjw.dal.dao.ExcelInfoMapper;
+import com.wxjw.service.GetFileTreeService;
+import jakarta.annotation.Resource;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+/**
+ * Controller 获取文件树
+ *
+ * @author 筱锋xiao_lfeng
+ */
+
+@RestController
+@RequestMapping("/openapi/")
+public class GetFileTreeController {
+ @Resource
+ ExcelInfoMapper excelInfoMapper;
+
+ @PostMapping("/files/tree")
+ public ResponseEntity> getFileTree(@RequestBody @NotNull HashMap resultBody) {
+ String getResult = resultBody.get("action");
+ if ("getfiletree".equals(getResult)) {
+ return ResponseEntity.ok()
+ .body(new GetFileTreeService().getFileTreeService(excelInfoMapper));
+ } else {
+ return ResponseEntity.badRequest()
+ .body(new Result<>(403, null, "参数错误"));
+ }
+ }
+}
diff --git a/src/main/java/com/wxjw/dal/dao/ExcelInfoMapper.java b/src/main/java/com/wxjw/dal/dao/ExcelInfoMapper.java
new file mode 100644
index 0000000..24e3e8a
--- /dev/null
+++ b/src/main/java/com/wxjw/dal/dao/ExcelInfoMapper.java
@@ -0,0 +1,48 @@
+package com.wxjw.dal.dao;
+
+import com.wxjw.dal.pojo.entity.ExcelInfoEntity;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.context.annotation.ComponentScan;
+
+import java.util.List;
+
+/**
+ * Mapper 数据库相关 接口
+ *
+ * @author 筱锋xiao_lfeng
+ */
+@Mapper
+@ComponentScan
+public interface ExcelInfoMapper {
+
+ /**
+ * @return 返回全部的数据(不加以修饰)
+ */
+ @Select("SELECT * FROM excel_file_handling.excel_info")
+ List getAllExcelInfos();
+
+ /**
+ * @return 返回全部的文件名称(去重)
+ */
+ @Select("SELECT t1.* FROM excel_file_handling.excel_info t1 LEFT JOIN excel_file_handling.excel_info t2 ON t1.file_name = t2.file_name AND t1.id < t2.id WHERE t2.id")
+ List getAllExcelFilesName();
+
+
+ /**
+ * @param id 主键
+ * @param parentId 父级 ID
+ * @param fileName 文件名称
+ * @param sheetName sheet 名称
+ * @param tableName 表名称
+ * @param type 类型
+ * @param createBy 创建者
+ * @param createTime 创建时间
+ * @param updateBy 更新者
+ * @param updateTime 更新时间
+ * @return 是否插入成功
+ */
+ @Insert("INSERT INTO excel_file_handling.excel_info (`id`,`parent_id`,`file_name`,`sheet_name`,`table_name`,`type`,`create_by`,`create_time`,`update_by`,`update_time`) VALUES (#{id}, #{parentId},#{fileName},#{sheetName},#{tableName},#{type},#{createBy}, #{createTime},#{updateBy},#{updateTime})")
+ boolean insertExcelInfo(int id, int parentId, String fileName, String sheetName, String tableName, int type, String createBy, String createTime, String updateBy, String updateTime);
+}
diff --git a/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeChildren.java b/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeChildren.java
new file mode 100644
index 0000000..e82f9ab
--- /dev/null
+++ b/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeChildren.java
@@ -0,0 +1,17 @@
+package com.wxjw.dal.pojo.data.getFileTree;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * Data 自定义 GetFileTreeController 实体类构造 父亲
+ *
+ * @author 筱锋xiao_lfeng
+ */
+@Data
+@AllArgsConstructor
+public class GetFileTreeChildren {
+ private String name;
+ private int id;
+ private T children;
+}
diff --git a/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeFather.java b/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeFather.java
new file mode 100644
index 0000000..bf75ac9
--- /dev/null
+++ b/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeFather.java
@@ -0,0 +1,17 @@
+package com.wxjw.dal.pojo.data.getFileTree;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * Data 自定义 GetFileTreeController 实体类构造 父亲
+ *
+ * @author 筱锋xiao_lfeng
+ */
+@Data
+@AllArgsConstructor
+public class GetFileTreeFather {
+ private String name;
+ private boolean open;
+ private T children;
+}
diff --git a/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeSheet.java b/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeSheet.java
new file mode 100644
index 0000000..cdb4979
--- /dev/null
+++ b/src/main/java/com/wxjw/dal/pojo/data/getFileTree/GetFileTreeSheet.java
@@ -0,0 +1,16 @@
+package com.wxjw.dal.pojo.data.getFileTree;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+
+/**
+ * Data 自定义 GetFileTreeController 实体类构造 父亲
+ *
+ * @author 筱锋xiao_lfeng
+ */
+@Data
+@AllArgsConstructor
+public class GetFileTreeSheet {
+ private String name;
+ private int id;
+}
diff --git a/src/main/java/com/wxjw/dal/pojo/entity/ExcelInfoEntity.java b/src/main/java/com/wxjw/dal/pojo/entity/ExcelInfoEntity.java
new file mode 100644
index 0000000..814cbd1
--- /dev/null
+++ b/src/main/java/com/wxjw/dal/pojo/entity/ExcelInfoEntity.java
@@ -0,0 +1,23 @@
+package com.wxjw.dal.pojo.entity;
+
+import lombok.Data;
+import org.springframework.lang.Nullable;
+
+/**
+ * Entity Excel数据表实体类
+ *
+ * @author 筱锋xiao_lfeng
+ */
+@Data
+public class ExcelInfoEntity {
+ private int id;
+ private int parentId;
+ @Nullable private String fileName;
+ @Nullable private String sheetName;
+ @Nullable private String tableName;
+ private int type;
+ @Nullable private String createBy;
+ @Nullable private String createTime;
+ @Nullable private String updateBy;
+ @Nullable private String updateTime;
+}
diff --git a/src/main/java/com/wxjw/service/GetFileTreeService.java b/src/main/java/com/wxjw/service/GetFileTreeService.java
new file mode 100644
index 0000000..b9e0a2a
--- /dev/null
+++ b/src/main/java/com/wxjw/service/GetFileTreeService.java
@@ -0,0 +1,58 @@
+package com.wxjw.service;
+
+import com.wxjw.common.Result;
+import com.wxjw.dal.dao.ExcelInfoMapper;
+import com.wxjw.dal.pojo.data.getFileTree.GetFileTreeChildren;
+import com.wxjw.dal.pojo.data.getFileTree.GetFileTreeFather;
+import com.wxjw.dal.pojo.data.getFileTree.GetFileTreeSheet;
+import com.wxjw.dal.pojo.entity.ExcelInfoEntity;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+
+/**
+ * Service GetFileTree逻辑服务处理
+ *
+ * @author 筱锋xiao_lfeng
+ */
+
+@Service
+public class GetFileTreeService {
+
+ public Result