This commit is contained in:
wangliwen 2022-07-14 11:08:56 +08:00
commit 74edb1ef0c
4 changed files with 6 additions and 4 deletions

View File

@ -114,4 +114,5 @@ public class CodeGenerationUtils {
public static CodeGenerationUtils getInstance() {
return CodeGenerationUtilsEnum.INSTANCE.getInstnce();
}
}

View File

@ -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());
}

View File

@ -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;
}

View File

@ -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());