@GetMapping("/exportPushUserModle")
public void exportPushUserModle(HttpServletResponse response) throws Exception {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setCharacterEncoding("utf-8");
response.addHeader("Content-Disposition", "attachment;filename=push_user.xls");
ClassPathResource classPathResourceSimple = new ClassPathResource("/excel/push_user.xls");
try (InputStream is = classPathResourceSimple.getInputStream()) {
IOUtils.copy(is, response.getOutputStream());
}
response.flushBuffer();
}
import org.apache.commons.io.IOUtils;