提交修改
This commit is contained in:
parent
5f47ef0e01
commit
944d46fd58
@ -0,0 +1,43 @@
|
||||
package com.heyu.api.controller.mm;
|
||||
|
||||
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.oss.OssFileUploadService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/upload")
|
||||
public class AdminUploadOssController {
|
||||
|
||||
@Autowired
|
||||
private OssFileUploadService ossFileUploadService;
|
||||
|
||||
|
||||
/**
|
||||
* post man 配置
|
||||
* https://blog.csdn.net/maowendi/article/details/80537304
|
||||
* <p>
|
||||
* <p>
|
||||
* http://localhost:8888/mm/upload/file file
|
||||
*/
|
||||
// todo
|
||||
@PostMapping("/file")
|
||||
public R uploadFile(HttpServletRequest request, HttpServletResponse response, @RequestParam("file") MultipartFile file) {
|
||||
List<Map<String, Object>> data = ossFileUploadService.uploadImages(new MultipartFile[]{file});
|
||||
return R.ok().setData(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user