| | |
| | | } |
| | | |
| | | @GetMapping("generat") |
| | | public void generat(String id, String remark,String zipFileName, HttpServletResponse response) throws IOException { |
| | | byte[] data = mpkFileService.generatorCode(id, remark,zipFileName); |
| | | public void generat(String id, String remark,String zipFileName, HttpServletResponse response) { |
| | | try { |
| | | byte[] data = mpkFileService.generatorCode(id, remark,zipFileName); |
| | | |
| | | response.reset(); |
| | | response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(zipFileName, "UTF-8") + "\""); |
| | | response.addHeader("Content-Length", "" + data.length); |
| | | response.setContentType("application/octet-stream; charset=UTF-8"); |
| | | response.reset(); |
| | | response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(zipFileName, "UTF-8") + "\""); |
| | | response.addHeader("Content-Length", "" + data.length); |
| | | response.setContentType("application/octet-stream; charset=UTF-8"); |
| | | |
| | | IOUtils.write(data, response.getOutputStream()); |
| | | IOUtils.write(data, response.getOutputStream()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("代码生成异常"); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("packageModel") |