VTracyHuang opened a new issue #2055:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2055


       @ApiOperation(value = "下载导入模板")
       @GetMapping("/action/exportTempalte")
       public ResponseEntity<String> exportExcelTempalte(HttpServletResponse 
response){
           try{
               //Resource目录中的文件
               String filePath = "/excels/讲师新增模板.xlsx";
               ClassPathResource classPathResource = new 
ClassPathResource(filePath);
               Workbook workbook= 
WorkbookFactory.create(classPathResource.getInputStream());
               ExcelUtil.downLoadExcel("讲师新增模板.xlsx", response, workbook);
           }catch (Exception e){
               e.printStackTrace();
               logger.error("文件下载失败,msg{}",e.getMessage());
           }
           return ResponseEntity.ok("success");
       }


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to