添加文件上传进度条

This commit is contained in:
wuchunlei
2024-03-13 14:33:24 +08:00
parent fb1426398f
commit e6d1250cf6
3 changed files with 32 additions and 5 deletions

View File

@@ -7,10 +7,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
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.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@Slf4j
@RestController
@@ -32,4 +29,13 @@ public class OssController {
String url = ossService.uploadFileAvatar(file);
return R.ok().put("url",url);
}
//获取进度条
@GetMapping("/getSchedule")
public R getSchedule(String fileName){
String percent = ossService.getSchedule(fileName);
return R.ok().put("percent",percent);
}
}