增加定时清理回收站文件

This commit is contained in:
2026-04-03 22:27:43 +08:00
parent d47c60a5e0
commit 97f1482497
18 changed files with 220 additions and 59 deletions

View File

@@ -29,6 +29,22 @@ public class UserController {
@Value("${file.storage.path:./uploads}")
private String storagePath;
@Value("${file.user.storage-limit-gb:50}")
private int storageLimitGb;
/**
* 获取系统配置(存储配额等)
*/
@GetMapping("/config")
public ResponseEntity<?> getSystemConfig() {
return ResponseEntity.ok(Map.of(
"data", Map.of(
"storageLimitGb", storageLimitGb,
"storageLimitBytes", (long) storageLimitGb * 1024 * 1024 * 1024
)
));
}
/**
* 获取所有可用用户(用于文件共享等场景)
*/
@@ -41,7 +57,7 @@ public class UserController {
Map<String, Object> m = new java.util.HashMap<>();
m.put("id", u.getId());
m.put("username", u.getUsername());
m.put("nickname", u.getNickname() != null ? u.getNickname() : u.getUsername());
m.put("nickname", u.getNickname());
m.put("avatar", u.getAvatar());
m.put("signature", u.getSignature());
return m;