From f81c345f7bf058fdfe5fee6f0dfd5de0f4cb767c Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期一, 12 五月 2025 16:29:02 +0800 Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/product-inventory-management-after --- src/main/java/com/ruoyi/other/controller/TempFileController.java | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/ruoyi/other/controller/TempFileController.java b/src/main/java/com/ruoyi/other/controller/TempFileController.java new file mode 100644 index 0000000..6834d13 --- /dev/null +++ b/src/main/java/com/ruoyi/other/controller/TempFileController.java @@ -0,0 +1,29 @@ +package com.ruoyi.other.controller; + + +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.other.service.TempFileService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + + +@RestController +@RequestMapping("/file") +@AllArgsConstructor +public class TempFileController { + + private TempFileService tempFileService; + + @PostMapping("/upload") + public AjaxResult uploadFile(MultipartFile file) { + try { + return AjaxResult.success(tempFileService.uploadFile(file)); + }catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + +} -- Gitblit v1.9.3