| | |
| | | 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);
|
| | | map.put("tables", tables);
|
| | | return AjaxResult.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)
|
| | |
| | | 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);
|