AI测试反馈的报错调整
This commit is contained in:
+1
-1
@@ -198,7 +198,7 @@ public class LogController {
|
||||
@GetMapping("/teaching-log/download-template")
|
||||
public void downloadTemplate(HttpServletResponse response) {
|
||||
try {
|
||||
java.io.InputStream is = getClass().getClassLoader().getResourceAsStream("template/导入教学日志模板.xls");
|
||||
java.io.InputStream is = getClass().getClassLoader().getResourceAsStream("file/导入教学日志模板.xls");
|
||||
if (is == null) {
|
||||
response.setStatus(404);
|
||||
return;
|
||||
|
||||
+3
-6
@@ -92,11 +92,8 @@ public class TeachingPlanController {
|
||||
* 下载教学实施计划导入模板
|
||||
*/
|
||||
@GetMapping("/template")
|
||||
public ResponseEntity<org.springframework.core.io.Resource> downloadTemplate() throws IOException {
|
||||
ClassPathResource resource = new ClassPathResource("template/教学实施计划导入模板.xlsx");
|
||||
if (!resource.exists()) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
public ResponseEntity<byte[]> downloadTemplate() throws Exception {
|
||||
byte[] bytes = teachingPlanService.buildImportTemplate();
|
||||
String fileName = URLEncoder.encode("教学实施计划导入模板.xlsx", "UTF-8");
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
@@ -105,6 +102,6 @@ public class TeachingPlanController {
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.headers(headers)
|
||||
.body(resource);
|
||||
.body(bytes);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user