增加定时清理回收站文件
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user