修复多表代码生成

This commit is contained in:
TinyAnts 2022-07-14 16:53:13 +08:00
parent a97f718393
commit fdae717b4e
1 changed files with 9 additions and 5 deletions

View File

@ -138,13 +138,17 @@ public class GenController {
* 生成代码 * 生成代码
* *
* @author fzr * @author fzr
* @param tableName 表名 * @param tables 表名
*/ */
@GetMapping("/genCode") @GetMapping("/genCode")
public void genCode(String tableName) { public Object genCode(String tables) {
Assert.notNull(tableName, "请选择要生成的表"); Assert.notNull(tables, "请选择要生成的表");
String[] tableNames = tables.split(",");
for (String tableName : tableNames) {
iGenerateService.genCode(tableName); iGenerateService.genCode(tableName);
} }
return AjaxResult.success();
}
/** /**
* 下载代码 * 下载代码
@ -154,7 +158,7 @@ public class GenController {
* @throws IOException 异常 * @throws IOException 异常
*/ */
@GetMapping("/downloadCode") @GetMapping("/downloadCode")
public void genCode(HttpServletResponse response, String tables) throws IOException { public void downloadCode(HttpServletResponse response, String tables) throws IOException {
Assert.notNull(tables, "请选择要生成的表"); Assert.notNull(tables, "请选择要生成的表");
String[] tableNames = tables.split(","); String[] tableNames = tables.split(",");
byte[] data = iGenerateService.downloadCode(tableNames); byte[] data = iGenerateService.downloadCode(tableNames);