diff --git a/renren-admin/src/main/java/io/renren/common/utils/CodeGenerationUtils.java b/renren-admin/src/main/java/io/renren/common/utils/CodeGenerationUtils.java index e9aeb3bf..206e2edf 100644 --- a/renren-admin/src/main/java/io/renren/common/utils/CodeGenerationUtils.java +++ b/renren-admin/src/main/java/io/renren/common/utils/CodeGenerationUtils.java @@ -114,4 +114,5 @@ public class CodeGenerationUtils { public static CodeGenerationUtils getInstance() { return CodeGenerationUtilsEnum.INSTANCE.getInstnce(); } + } diff --git a/renren-admin/src/main/java/io/renren/modules/developmentGuide/controller/DevelopmentGuideController.java b/renren-admin/src/main/java/io/renren/modules/developmentGuide/controller/DevelopmentGuideController.java index a8357d07..bc97b74c 100644 --- a/renren-admin/src/main/java/io/renren/modules/developmentGuide/controller/DevelopmentGuideController.java +++ b/renren-admin/src/main/java/io/renren/modules/developmentGuide/controller/DevelopmentGuideController.java @@ -48,8 +48,8 @@ public class DevelopmentGuideController { }) public Result uploadDevelopmentFile(@RequestParam("file") MultipartFile uploadFile, HttpServletRequest request) { try { - developmentGuideService.uploadDevelopmentFile(uploadFile, request); - return new Result(); + String s = developmentGuideService.uploadDevelopmentFile(uploadFile, request); + return new Result().ok(s); }catch (Exception e) { return new Result().error(e.getMessage()); } diff --git a/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/DevelopmentGuideService.java b/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/DevelopmentGuideService.java index d0c2c473..912ea558 100644 --- a/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/DevelopmentGuideService.java +++ b/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/DevelopmentGuideService.java @@ -9,5 +9,5 @@ public interface DevelopmentGuideService { void getDevelopmentFile(HttpServletRequest request, HttpServletResponse response) throws Exception; - void uploadDevelopmentFile(MultipartFile uploadFile, HttpServletRequest request) throws Exception; + String uploadDevelopmentFile(MultipartFile uploadFile, HttpServletRequest request) throws Exception; } diff --git a/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/impl/DevelopmentGuideServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/impl/DevelopmentGuideServiceImpl.java index eb733f49..d3724718 100644 --- a/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/impl/DevelopmentGuideServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/developmentGuide/service/impl/DevelopmentGuideServiceImpl.java @@ -61,7 +61,7 @@ public class DevelopmentGuideServiceImpl implements DevelopmentGuideService { } @Override - public void uploadDevelopmentFile(MultipartFile uploadFile, HttpServletRequest request) throws Exception{ + public String uploadDevelopmentFile(MultipartFile uploadFile, HttpServletRequest request) throws Exception{ logger.info("----------------------------------开始上传开发指南--------------------------------------------------"); String type = request.getParameter("type"); String fileName = request.getParameter("fileName"); @@ -81,6 +81,7 @@ public class DevelopmentGuideServiceImpl implements DevelopmentGuideService { // 文件保存 uploadFile.transferTo(new File(path, fileName)); logger.info("----------------------------------文件上传成功--------------------------------------"); + return folder.getPath(); } catch (IOException e) { logger.info("----------------------------------文件上传失败--------------------------------------"); logger.info("异常描述" + e.getMessage());