fix -- 修改响应体AjaxResult.java为R.java

This commit is contained in:
hewenqiang
2021-12-21 10:26:42 +08:00
parent 501435d5aa
commit 18ac3ab725
35 changed files with 314 additions and 315 deletions

View File

@@ -4,7 +4,7 @@ import cn.hutool.core.convert.Convert;
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.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.generator.domain.GenTable;
@@ -56,7 +56,7 @@ public class GenController extends BaseController {
@ApiOperation("修改代码生成业务")
@PreAuthorize("@ss.hasPermi('tool:gen:query')")
@GetMapping(value = "/{talbleId}")
public AjaxResult<Map<String, Object>> getInfo(@PathVariable Long talbleId) {
public R<Map<String, Object>> getInfo(@PathVariable Long talbleId) {
GenTable table = genTableService.selectGenTableById(talbleId);
List<GenTable> tables = genTableService.selectGenTableAll();
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(talbleId);
@@ -64,7 +64,7 @@ public class GenController extends BaseController {
map.put("info", table);
map.put("rows", list);
map.put("tables", tables);
return AjaxResult.success(map);
return R.success(map);
}
/**
@@ -98,12 +98,12 @@ public class GenController extends BaseController {
@PreAuthorize("@ss.hasPermi('tool:gen:import')")
@Log(title = "代码生成", 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.success();
}
/**
@@ -113,10 +113,10 @@ public class GenController extends BaseController {
@PreAuthorize("@ss.hasPermi('tool:gen:edit')")
@Log(title = "代码生成", 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.success();
}
/**
@@ -126,9 +126,9 @@ public class GenController extends BaseController {
@PreAuthorize("@ss.hasPermi('tool:gen:remove')")
@Log(title = "代码生成", 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.success();
}
/**
@@ -137,9 +137,9 @@ public class GenController extends BaseController {
@ApiOperation("预览代码")
@PreAuthorize("@ss.hasPermi('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.success(dataMap);
}
/**
@@ -161,9 +161,9 @@ public class GenController extends BaseController {
@PreAuthorize("@ss.hasPermi('tool:gen:code')")
@Log(title = "代码生成", 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.success();
}
/**
@@ -173,9 +173,9 @@ public class GenController extends BaseController {
@PreAuthorize("@ss.hasPermi('tool:gen:edit')")
@Log(title = "代码生成", 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.success();
}
/**