| | |
| | | map.put("info", table);
|
| | | map.put("rows", list);
|
| | | map.put("tables", tables);
|
| | | return AjaxResult.success(map);
|
| | | return success(map);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | // 查询表信息
|
| | | List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
|
| | | genTableService.importGenTable(tableList);
|
| | | return AjaxResult.success();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | genTableService.validateEdit(genTable);
|
| | | genTableService.updateGenTable(genTable);
|
| | | return AjaxResult.success();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public AjaxResult remove(@PathVariable Long[] tableIds)
|
| | | {
|
| | | genTableService.deleteGenTableByIds(tableIds);
|
| | | return AjaxResult.success();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException
|
| | | {
|
| | | Map<String, String> dataMap = genTableService.previewCode(tableId);
|
| | | return AjaxResult.success(dataMap);
|
| | | return success(dataMap);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public AjaxResult genCode(@PathVariable("tableName") String tableName)
|
| | | {
|
| | | genTableService.generatorCode(tableName);
|
| | | return AjaxResult.success();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
| | | {
|
| | | genTableService.synchDb(tableName);
|
| | | return AjaxResult.success();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | private void genCode(HttpServletResponse response, byte[] data) throws IOException
|
| | | {
|
| | | response.reset();
|
| | | response.addHeader("Access-Control-Allow-Origin", "*");
|
| | | response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
| | | response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
| | | response.addHeader("Content-Length", "" + data.length);
|