You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/11/13 06:22:39 UTC

[GitHub] [servicecomb-java-chassis] VTracyHuang opened a new issue #2055: 不能这么写吗? 里面没有model,还是报错Caused by: org.apache.servicecomb.foundation.common.exceptions.ServiceCombException: [simple type, class java.util.function.Supplier] is interface. Must be a concrete type.

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:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] VTracyHuang closed issue #2055: 不能这么写吗? 里面没有model,还是报错Caused by: org.apache.servicecomb.foundation.common.exceptions.ServiceCombException: [simple type, class java.util.function.Supplier] is interface. Must be a concrete type.

Posted by GitBox <gi...@apache.org>.
VTracyHuang closed issue #2055:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2055


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2055: 不能这么写吗? 里面没有model,还是报错Caused by: org.apache.servicecomb.foundation.common.exceptions.ServiceCombException: [simple type, class java.util.function.Supplier] is interface. Must be a concrete type.

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2055:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2055#issuecomment-726550195


   不可以的。 参考[开发指南](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/interface-constraints/)的说明, HttpServlepResponse 不能作为请求参数。 
   
   [上传下载文件参考](https://docs.servicecomb.io/java-chassis/zh_CN/general-development/upload-download/)
   [spring mvc 和 servicecomb 的差异](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/springmvc/)
   


----------------------------------------------------------------
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:
users@infra.apache.org