From a7c522a61fae4af3420cb7541b3696f0b6091898 Mon Sep 17 00:00:00 2001
From: acite <1498045907@qq.com>
Date: Sat, 20 Sep 2025 14:22:08 +0800
Subject: [PATCH] [feat] Optional recursive
---
.idea/.idea.Abyss/.idea/workspace.xml | 5 +++++
Abyss/Components/Controllers/Security/RootController.cs | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/.idea/.idea.Abyss/.idea/workspace.xml b/.idea/.idea.Abyss/.idea/workspace.xml
index e41d2d9..943dece 100644
--- a/.idea/.idea.Abyss/.idea/workspace.xml
+++ b/.idea/.idea.Abyss/.idea/workspace.xml
@@ -11,6 +11,7 @@
+
@@ -223,6 +224,10 @@
+
+
+
+
diff --git a/Abyss/Components/Controllers/Security/RootController.cs b/Abyss/Components/Controllers/Security/RootController.cs
index 762a5ee..01eea08 100644
--- a/Abyss/Components/Controllers/Security/RootController.cs
+++ b/Abyss/Components/Controllers/Security/RootController.cs
@@ -11,7 +11,7 @@ public class RootController(ILogger logger, UserService userServ
: BaseController
{
[HttpPost("chmod")]
- public async Task Chmod(string token, string path, string permission)
+ public async Task Chmod(string token, string path, string permission, string? recursive)
{
logger.LogInformation("Chmod method called with path: {Path}, permission: {Permission}", path, permission);
@@ -21,13 +21,13 @@ public class RootController(ILogger logger, UserService userServ
return StatusCode(401, "Unauthorized");
}
- bool r = await resourceService.Chmod(path, token, permission, Ip, true);
+ bool r = await resourceService.Chmod(path, token, permission, Ip, recursive == "true");
logger.LogInformation("Chmod operation completed with result: {Result}", r);
return r ? Ok() : StatusCode(502);
}
[HttpPost("chown")]
- public async Task Chown(string token, string path, int owner)
+ public async Task Chown(string token, string path, int owner, string? recursive)
{
logger.LogInformation("Chown method called with path: {Path}, owner: {Owner}", path, owner);
@@ -37,7 +37,7 @@ public class RootController(ILogger logger, UserService userServ
return StatusCode(401, "Unauthorized");
}
- bool r = await resourceService.Chown(path, token, owner, Ip, true);
+ bool r = await resourceService.Chown(path, token, owner, Ip, recursive == "true");
logger.LogInformation("Chown operation completed with result: {Result}", r);
return r ? Ok() : StatusCode(502);
}