From ea53b3faba7222394f5bff8dbb1966ab40ec4536 Mon Sep 17 00:00:00 2001
From: xlt <xlt@xialuotang.com>
Date: 星期六, 05 三月 2022 01:27:02 +0800
Subject: [PATCH] fix 修复talbleId的单词拼写错误,应为tableId

---
 ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java |   42 ++++++++++++++++++++----------------------
 1 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
index c0cce72..e9e61e7 100644
--- a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
+++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
@@ -5,13 +5,12 @@
 import cn.hutool.core.io.IoUtil;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.PageQuery;
+import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.generator.domain.GenTable;
 import com.ruoyi.generator.domain.GenTableColumn;
-import com.ruoyi.generator.service.IGenTableColumnService;
 import com.ruoyi.generator.service.IGenTableService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -38,7 +37,6 @@
 public class GenController extends BaseController {
 
     private final IGenTableService genTableService;
-    private final IGenTableColumnService genTableColumnService;
 
     /**
      * 鏌ヨ浠g爜鐢熸垚鍒楄〃
@@ -55,16 +53,16 @@
      */
     @ApiOperation("淇敼浠g爜鐢熸垚涓氬姟")
     @SaCheckPermission("tool:gen:query")
-    @GetMapping(value = "/{talbleId}")
-    public AjaxResult<Map<String, Object>> getInfo(@PathVariable Long talbleId) {
-        GenTable table = genTableService.selectGenTableById(talbleId);
+    @GetMapping(value = "/{tableId}")
+    public R<Map<String, Object>> getInfo(@PathVariable Long tableId) {
+        GenTable table = genTableService.selectGenTableById(tableId);
         List<GenTable> tables = genTableService.selectGenTableAll();
-        List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
+        List<GenTableColumn> list = genTableService.selectGenTableColumnListByTableId(tableId);
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("info", table);
         map.put("rows", list);
         map.put("tables", tables);
-        return AjaxResult.success(map);
+        return R.ok(map);
     }
 
     /**
@@ -82,10 +80,10 @@
      */
     @ApiOperation("鏌ヨ鏁版嵁琛ㄥ瓧娈靛垪琛�")
     @SaCheckPermission("tool:gen:list")
-    @GetMapping(value = "/column/{talbleId}")
+    @GetMapping(value = "/column/{tableId}")
     public TableDataInfo<GenTableColumn> columnList(Long tableId) {
         TableDataInfo<GenTableColumn> dataInfo = new TableDataInfo<>();
-        List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
+        List<GenTableColumn> list = genTableService.selectGenTableColumnListByTableId(tableId);
         dataInfo.setRows(list);
         dataInfo.setTotal(list.size());
         return dataInfo;
@@ -98,12 +96,12 @@
     @SaCheckPermission("tool:gen:import")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.IMPORT)
     @PostMapping("/importTable")
-    public AjaxResult<Void> importTableSave(String tables) {
+    public R<Void> importTableSave(String tables) {
         String[] tableNames = Convert.toStrArray(tables);
         // 鏌ヨ琛ㄤ俊鎭�
         List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
         genTableService.importGenTable(tableList);
-        return AjaxResult.success();
+        return R.ok();
     }
 
     /**
@@ -113,10 +111,10 @@
     @SaCheckPermission("tool:gen:edit")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult<Void> editSave(@Validated @RequestBody GenTable genTable) {
+    public R<Void> editSave(@Validated @RequestBody GenTable genTable) {
         genTableService.validateEdit(genTable);
         genTableService.updateGenTable(genTable);
-        return AjaxResult.success();
+        return R.ok();
     }
 
     /**
@@ -126,9 +124,9 @@
     @SaCheckPermission("tool:gen:remove")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.DELETE)
     @DeleteMapping("/{tableIds}")
-    public AjaxResult<Void> remove(@PathVariable Long[] tableIds) {
+    public R<Void> remove(@PathVariable Long[] tableIds) {
         genTableService.deleteGenTableByIds(tableIds);
-        return AjaxResult.success();
+        return R.ok();
     }
 
     /**
@@ -137,9 +135,9 @@
     @ApiOperation("棰勮浠g爜")
     @SaCheckPermission("tool:gen:preview")
     @GetMapping("/preview/{tableId}")
-    public AjaxResult<Map<String, String>> preview(@PathVariable("tableId") Long tableId) throws IOException {
+    public R<Map<String, String>> preview(@PathVariable("tableId") Long tableId) throws IOException {
         Map<String, String> dataMap = genTableService.previewCode(tableId);
-        return AjaxResult.success(dataMap);
+        return R.ok(dataMap);
     }
 
     /**
@@ -161,9 +159,9 @@
     @SaCheckPermission("tool:gen:code")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.GENCODE)
     @GetMapping("/genCode/{tableName}")
-    public AjaxResult<Void> genCode(@PathVariable("tableName") String tableName) {
+    public R<Void> genCode(@PathVariable("tableName") String tableName) {
         genTableService.generatorCode(tableName);
-        return AjaxResult.success();
+        return R.ok();
     }
 
     /**
@@ -173,9 +171,9 @@
     @SaCheckPermission("tool:gen:edit")
     @Log(title = "浠g爜鐢熸垚", businessType = BusinessType.UPDATE)
     @GetMapping("/synchDb/{tableName}")
-    public AjaxResult<Void> synchDb(@PathVariable("tableName") String tableName) {
+    public R<Void> synchDb(@PathVariable("tableName") String tableName) {
         genTableService.synchDb(tableName);
-        return AjaxResult.success();
+        return R.ok();
     }
 
     /**

--
Gitblit v1.9.3