From d8d8758cfa2be580e02949a8266cb3c68da97efa Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 03 Jun 2021 13:55:22 +0800
Subject: [PATCH] 修复关闭confirm提示框控制台报错问题
---
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