| | |
| | | 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);
|
| | | return AjaxResult.success(map);
|
| | | map.put("tables", tables);
|
| | | return success(map);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * 查询数据表字段列表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
| | | @GetMapping(value = "/column/{talbleId}")
|
| | | @GetMapping(value = "/column/{tableId}")
|
| | | public TableDataInfo columnList(Long tableId)
|
| | | {
|
| | | TableDataInfo dataInfo = new TableDataInfo();
|
| | |
| | | /**
|
| | | * 导入表结构(保存)
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:list')")
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:import')")
|
| | | @Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
| | | @PostMapping("/importTable")
|
| | | public AjaxResult importTableSave(String tables)
|
| | |
| | | // 查询表信息
|
| | | 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);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @PreAuthorize("@ss.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();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 同步数据库
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('tool:gen:edit')")
|
| | | @Log(title = "代码生成", businessType = BusinessType.UPDATE)
|
| | | @GetMapping("/synchDb/{tableName}")
|
| | | public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
| | | {
|
| | | genTableService.synchDb(tableName);
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|