|
|
|
@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
|
import org.springframework.mock.web.MockMultipartFile;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import com.flossom.common.core.domain.R;
|
|
|
|
import com.flossom.common.core.domain.R;
|
|
|
|
@ -36,7 +37,7 @@ public class SysFileController {
|
|
|
|
* 文件上传请求
|
|
|
|
* 文件上传请求
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("upload")
|
|
|
|
@PostMapping("upload")
|
|
|
|
public R<SysFile> upload(MultipartFile file) {
|
|
|
|
public R<SysFile> upload(@RequestParam("file") MultipartFile file) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// 上传并返回访问地址
|
|
|
|
// 上传并返回访问地址
|
|
|
|
log.info("文件上传前名称:{}", file.getOriginalFilename());
|
|
|
|
log.info("文件上传前名称:{}", file.getOriginalFilename());
|
|
|
|
@ -59,7 +60,7 @@ public class SysFileController {
|
|
|
|
* 文件上传请求
|
|
|
|
* 文件上传请求
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("upload/else")
|
|
|
|
@PostMapping("upload/else")
|
|
|
|
public R<SysFile> upload(MultipartFile file, int index, String condition) {
|
|
|
|
public R<SysFile> upload(@RequestParam("file") MultipartFile file, int index, String condition) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// 上传并返回访问地址
|
|
|
|
// 上传并返回访问地址
|
|
|
|
log.info("文件上传前名称:{}", file.getOriginalFilename());
|
|
|
|
log.info("文件上传前名称:{}", file.getOriginalFilename());
|
|
|
|
|