|
@@ -0,0 +1,46 @@
|
|
|
+package com.qunzhixinxi.hnqz.admin.oe.controller;
|
|
|
+
|
|
|
+import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
|
+import com.qunzhixinxi.hnqz.common.log.annotation.SysLog;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * oe文件控制器
|
|
|
+ *
|
|
|
+ * @author lixuesong
|
|
|
+ * @date 2023/08/08
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@RestController
|
|
|
+@RequestMapping("/oe/file")
|
|
|
+public class OeFileController {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 文件上传
|
|
|
+ *
|
|
|
+ * @param file 文件
|
|
|
+ * @return {@link R}<{@link Map}<{@link String}, {@link String}>>
|
|
|
+ */
|
|
|
+ @SysLog("OE文件上传")
|
|
|
+ @PostMapping("/upload")
|
|
|
+ public R<Map<String, String>> upload(@RequestParam("file") MultipartFile file) {
|
|
|
+ log.info("OE文件上传参数:name={},size={},content-type={}", file.getOriginalFilename(), file.getSize(), file.getContentType());
|
|
|
+
|
|
|
+ // TODO
|
|
|
+
|
|
|
+ Map<String, String> resultMap = new HashMap<>(3);
|
|
|
+ resultMap.put("bucketName", "wmkj");
|
|
|
+ resultMap.put("fileName", "1f537bfcb30647889d5746403b2ce661.png");
|
|
|
+ resultMap.put("url", "/admin/sys-file/wmkj/1f537bfcb30647889d5746403b2ce661.png");
|
|
|
+
|
|
|
+ return R.ok(resultMap);
|
|
|
+ }
|
|
|
+}
|