Implement real async COS image upload

This commit is contained in:
Tim
2025-07-01 10:18:53 +08:00
parent 48abc381db
commit 87b9e9acd3
8 changed files with 77 additions and 10 deletions

View File

@@ -29,7 +29,7 @@ public class UserController {
@PostMapping("/me/avatar")
public ResponseEntity<?> uploadAvatar(@RequestParam("file") MultipartFile file,
Authentication auth) throws IOException {
String url = imageUploader.upload(file.getBytes(), file.getOriginalFilename());
String url = imageUploader.upload(file.getBytes(), file.getOriginalFilename()).join();
userService.updateAvatar(auth.getName(), url);
return ResponseEntity.ok(Map.of("url", url));
}