From 1e4ed04a65e41ca1e36fd8170e530da2a65ab69c Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Mon, 16 Aug 2021 22:26:29 +0800
Subject: [PATCH] 优化异常信息

---
 ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/controller/GenController.java |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/controller/GenController.java b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/controller/GenController.java
index b23ff55..3526bd9 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/controller/GenController.java
+++ b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/controller/GenController.java
@@ -63,10 +63,12 @@
     public AjaxResult getInfo(@PathVariable Long talbleId)
     {
         GenTable table = genTableService.selectGenTableById(talbleId);
+        List<GenTable> tables = genTableService.selectGenTableAll();
         List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("info", table);
         map.put("rows", list);
+        map.put("tables", tables);
         return AjaxResult.success(map);
     }
 
@@ -98,7 +100,7 @@
     /**
      * 导入表结构(保存)
      */
-    @PreAuthorize(hasPermi = "tool:gen:list")
+    @PreAuthorize(hasPermi = "tool:gen:import")
     @Log(title = "代码生成", businessType = BusinessType.IMPORT)
     @PostMapping("/importTable")
     public AjaxResult importTableSave(String tables)
@@ -164,13 +166,25 @@
     @PreAuthorize(hasPermi = "tool:gen:code")
     @Log(title = "代码生成", businessType = BusinessType.GENCODE)
     @GetMapping("/genCode/{tableName}")
-    public AjaxResult genCode(HttpServletResponse response, @PathVariable("tableName") String tableName)
+    public AjaxResult genCode(@PathVariable("tableName") String tableName)
     {
         genTableService.generatorCode(tableName);
         return AjaxResult.success();
     }
 
     /**
+     * 同步数据库
+     */
+    @PreAuthorize(hasPermi = "tool:gen:edit")
+    @Log(title = "代码生成", businessType = BusinessType.UPDATE)
+    @GetMapping("/synchDb/{tableName}")
+    public AjaxResult synchDb(@PathVariable("tableName") String tableName)
+    {
+        genTableService.synchDb(tableName);
+        return AjaxResult.success();
+    }
+
+    /**
      * 批量生成代码
      */
     @PreAuthorize(hasPermi = "tool:gen:code")

--
Gitblit v1.9.3