| | |
| | | import com.ruoyi.common.log.annotation.Log;
|
| | | import com.ruoyi.common.log.enums.BusinessType;
|
| | | import com.ruoyi.common.security.annotation.RequiresPermissions;
|
| | | import com.ruoyi.gen.config.GenConfig;
|
| | | import com.ruoyi.gen.domain.GenTable;
|
| | | import com.ruoyi.gen.domain.GenTableColumn;
|
| | | import com.ruoyi.gen.service.IGenTableColumnService;
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 修改代码生成业务
|
| | | * 获取代码生成信息
|
| | | */
|
| | | @RequiresPermissions("tool:gen:query")
|
| | | @GetMapping(value = "/{tableId}")
|
| | |
| | | map.put("info", table);
|
| | | map.put("rows", list);
|
| | | map.put("tables", tables);
|
| | | return AjaxResult.success(map);
|
| | | return success(map);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | /**
|
| | | * 查询数据表字段列表
|
| | | */
|
| | | @GetMapping(value = "/column/{talbleId}")
|
| | | @GetMapping(value = "/column/{tableId}")
|
| | | public TableDataInfo columnList(Long tableId)
|
| | | {
|
| | | TableDataInfo dataInfo = new TableDataInfo();
|
| | |
| | | // 查询表信息
|
| | | 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);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @GetMapping("/genCode/{tableName}")
|
| | | public AjaxResult genCode(@PathVariable("tableName") String tableName)
|
| | | {
|
| | | if (!GenConfig.isAllowOverwrite())
|
| | | {
|
| | | return AjaxResult.error("【系统预设】不允许生成文件覆盖到本地");
|
| | | }
|
| | | genTableService.generatorCode(tableName);
|
| | | return AjaxResult.success();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public AjaxResult synchDb(@PathVariable("tableName") String tableName)
|
| | | {
|
| | | genTableService.synchDb(tableName);
|
| | | return AjaxResult.success();
|
| | | return success();
|
| | | }
|
| | |
|
| | | /**
|