Skip to content

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

@VTracyHuang

Description

@VTracyHuang
@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");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions