| | |
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import jakarta.servlet.http.HttpServletResponse;
|
| | | import org.apache.commons.io.IOUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.validation.annotation.Validated;
|
| | |
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestParam;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.common.core.web.controller.BaseController;
|
| | |
| | | @RequiresPermissions("tool:gen:import")
|
| | | @Log(title = "代码生成", businessType = BusinessType.IMPORT)
|
| | | @PostMapping("/importTable")
|
| | | public AjaxResult importTableSave(String tables)
|
| | | public AjaxResult importTableSave(@RequestParam("tables") String tables, @RequestParam("tplWebType") String tplWebType)
|
| | | {
|
| | | String[] tableNames = Convert.toStrArray(tables);
|
| | | // 查询表信息
|
| | | List<GenTable> tableList = genTableService.selectDbTableListByNames(tableNames);
|
| | | genTableService.importGenTable(tableList);
|
| | | genTableService.importGenTable(tableList, tplWebType);
|
| | | return success();
|
| | | }
|
| | |
|