From da9a1ec472cdbb70b6c2b83378e777d5e8759453 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Thu, 13 Aug 2026 09:35:27 +0800 Subject: [PATCH] update: storage path --- API.md | 2 +- backend/src/backend/scripts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/API.md b/API.md index abb5be2..e6e0ae1 100644 --- a/API.md +++ b/API.md @@ -251,7 +251,7 @@ multipart/binary 形式上传大文件(走 server-proxied PUT,详见 §九)。 | `visibility` | enum | | | `status` | `active` \| `deleted` | | | `is_locked` | boolean | 是否锁定。`PUT /scripts/{id}`(§3.8) 受此字段门禁;可通过 §3.16 切换 | -| `relative_path` | string \| null | 例如 `users/alice/scripts/etl/train.py` | +| `relative_path` | string \| null | 例如 `workspace/01HXX.../scripts/etl/train.py`(以 `user_id` 为作用域) | | `content_hash` | string \| null | SHA-256 十六进制 | | `size_bytes` | int | | | `created_at` / `updated_at` | ISO-8601 | | diff --git a/backend/src/backend/scripts.py b/backend/src/backend/scripts.py index 4cb217a..1f51065 100644 --- a/backend/src/backend/scripts.py +++ b/backend/src/backend/scripts.py @@ -100,7 +100,7 @@ TREE_EXCLUDED_USAGE_TYPES = ( def user_relative_path(context: RequestContext, child_path: str = "") -> str: - base = f"users/{context.user.username}" + base = f"workspace/{context.user.user_id}" normalized = normalize_user_path(child_path) return f"{base}/{normalized}" if normalized else base