AI测试反馈的报错调整

This commit is contained in:
2026-09-18 18:12:59 +08:00
parent 68b02ea58e
commit f36b1f4701
16 changed files with 90 additions and 25 deletions
@@ -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;
@@ -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);
}
}