diff --git a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java index af73621..8ee1022 100644 --- a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java +++ b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java @@ -13,6 +13,8 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.web.bind.annotation.*; +import java.io.File; + @Slf4j @RestController public class EdiController extends BaseController { @@ -38,11 +40,19 @@ public class EdiController extends BaseController { public void exportPdfDemo(@RequestParam("param")String param) throws Exception{ System.out.println(System.getProperty("user.dir")); ClassPathResource classPathResource = new ClassPathResource("photo/title.png"); - System.out.println(classPathResource.getPath()); - System.out.println(classPathResource.getURL()); + try { + File file = classPathResource.getFile(); + System.out.println(file.getName()); + }catch (Exception e){ + log.error("",e); + } Resource resource = resourceLoader.getResource("classpath:photo/title.png"); - System.out.println(resource.getURL()); - System.out.println(classPathResource.getURL()); + try { + File file = resource.getFile(); + System.out.println(file.getName()); + }catch (Exception e){ + log.error("",e); + } // CourseFeedbackTemplateDto resultDTO = new CourseFeedbackTemplateDto(); // resultDTO.setProgram("program"); // resultDTO.setStudentName("student");