docs: Update storage proposal documentation to reflect completed features

- Revised the storage proposal to indicate the implementation status of various features, including folder management, file sharing, and file versioning.
- Updated sections to show completed APIs and functionalities, enhancing clarity on the current capabilities of the Storage Service.
- Marked planned features for search and discovery, ensuring a clear roadmap for future enhancements.
This commit is contained in:
Ho Ngoc Hai
2026-01-14 14:15:51 +07:00
parent d28ecc158d
commit 4f0008b422

View File

@@ -40,10 +40,10 @@ Tài liệu này mô tả kiến trúc cho Storage Service, microservice quản
- File metadata management - **Đã triển khai**
- User ownership validation - **Đã triển khai**
#### D. Folder Management (Planned)
- 🔄 Logical folder hierarchy
- 🔄 Folder CRUD operations
- 🔄 Move files between folders
#### D. Folder Management
- Logical folder hierarchy - **Đã triển khai**
- Folder CRUD operations - **Đã triển khai**
- ✅ Rename folder (O(1)) - **Đã triển khai**
### 1.2 Storage Infrastructure ✅
@@ -57,19 +57,20 @@ Tài liệu này mô tả kiến trúc cho Storage Service, microservice quản
- ✅ File count limits - **Đã triển khai**
- ✅ Usage tracking - **Đã triển khai**
### 1.3 Advanced Features (Planned)
### 1.3 Advanced Features
#### A. File Sharing
- 🔄 Share links với expiration
- 🔄 Permission-based sharing
- 🔄 Password-protected links
#### A. File Sharing
- Share links với expiration - **Đã triển khai**
- Permission-based sharing (View, Download, Edit, Admin) - **Đã triển khai**
- Password-protected links - **Đã triển khai**
- ✅ Max downloads limit - **Đã triển khai**
#### B. File Versioning
- 🔄 Version history
- 🔄 Rollback support
- 🔄 Diff between versions
#### B. File Versioning
- Version history - **Đã triển khai**
- Rollback/Restore support - **Đã triển khai**
- Download specific version - **Đã triển khai**
#### C. Search & Discovery
#### C. Search & Discovery (Planned)
- 🔄 Full-text search trong metadata
- 🔄 Tag-based filtering
- 🔄 Advanced search queries
@@ -156,13 +157,13 @@ graph TD
- **storage_files**: Metadata files (id, file_name, storage_key, content_type, size, access_level, provider)
- **user_storage_quotas**: Quota per user (max_storage, used_storage, max_files, current_files)
### 3.2 Extended Tables (Planned)
### 3.2 Extended Tables (Đã Triển Khai)
- **folders**: Logical folder hierarchy
- **file_shares**: Share links và permissions
- **file_versions**: Version history
- **multipart_uploads**: Tracking upload sessions
- **multipart_upload_parts**: Individual parts
- **folders**: Logical folder hierarchy
- **file_shares**: Share links và permissions
- **file_versions**: Version history
- **multipart_uploads**: Tracking upload sessions
- **multipart_upload_parts**: Individual parts
---
@@ -206,31 +207,32 @@ graph TD
| `DELETE` | `/api/v1/files/multipart/abort` | Hủy upload, cleanup | ✅ |
| `GET` | `/api/v1/files/multipart/{uploadId}` | Kiểm tra tiến độ | ✅ |
### 4.6 Folder APIs (Planned)
### 4.6 Folder APIs
> [!NOTE]
> Các APIs dưới đây là tính năng **đang được lên kế hoạch**, chưa triển khai.
| Method | Endpoint | Mô tả | Auth |
|--------|----------|-------|------|
| `POST` | `/api/v1/storage/folders` | Tạo folder mới | ✅ |
| `GET` | `/api/v1/storage/folders` | List folders (root hoặc children) | ✅ |
| `GET` | `/api/v1/storage/folders/{id}` | Lấy folder info | ✅ |
| `PUT` | `/api/v1/storage/folders/{id}` | Đổi tên folder (O(1)) | ✅ |
| `DELETE` | `/api/v1/storage/folders/{id}` | Xóa folder (soft delete) | ✅ |
```
POST /api/v1/folders # Tạo folder
GET /api/v1/folders # List folders
GET /api/v1/folders/{id} # Lấy folder info
PUT /api/v1/folders/{id} # Đổi tên folder
DELETE /api/v1/folders/{id} # Xóa folder
GET /api/v1/folders/{id}/files # List files trong folder
POST /api/v1/files/{id}/move # Move file giữa folders
```
### 4.7 File Sharing APIs ✅
### 4.7 File Sharing APIs (Planned)
| Method | Endpoint | Mô tả | Auth |
|--------|----------|-------|------|
| `POST` | `/api/v1/storage/files/{id}/shares` | Tạo share link | ✅ |
| `GET` | `/api/v1/storage/files/{id}/shares` | List shares của file | ✅ |
| `DELETE` | `/api/v1/storage/shares/{id}` | Thu hồi share link | ✅ |
| `GET` | `/api/v1/storage/shares/public/{token}` | Truy cập file được chia sẻ (public) | ❌ |
> [!NOTE]
> Các APIs dưới đây là tính năng **đang được lên kế hoạch**, chưa triển khai.
### 4.8 File Versioning APIs ✅
```
POST /api/v1/files/{id}/share # Tạo share link
GET /api/v1/shares/{token} # Access shared file
DELETE /api/v1/shares/{id} # Revoke share
```
| Method | Endpoint | Mô tả | Auth |
|--------|----------|-------|------|
| `GET` | `/api/v1/storage/files/{id}/versions` | Lấy danh sách versions | ✅ |
| `GET` | `/api/v1/storage/files/{id}/versions/{verId}/download` | Download version cụ thể | ✅ |
| `POST` | `/api/v1/storage/files/{id}/versions/{verId}/restore` | Khôi phục về version cũ | ✅ |
---
@@ -256,22 +258,28 @@ DELETE /api/v1/shares/{id} # Revoke share
- ✅ Upload completion/abort
- ✅ Progress tracking
### Phase 4: Logical Folders (Planned)
- 🔄 Folder hierarchy trong database
- 🔄 Folder CRUD APIs
- 🔄 Move files giữa folders
- 🔄 Recursive delete
### Phase 4: Logical Folders ✅ (Completed)
- Folder hierarchy trong database
- Folder CRUD APIs
- ✅ Rename folder O(1)
- ✅ Soft delete
### Phase 5: File Sharing (Planned)
- 🔄 Share link generation
- 🔄 Expiring share links
- 🔄 Password protection
- 🔄 Access logging
### Phase 5: File Sharing ✅ (Completed)
- Share link generation
- Expiring share links
- Password protection
- ✅ Permission levels (View, Download, Edit, Admin)
- ✅ Max downloads limit
### Phase 6: File Versioning (Planned)
- 🔄 Version tracking
- 🔄 Rollback support
- 🔄 Retention policies
### Phase 6: File Versioning ✅ (Completed)
- Version tracking
- ✅ Restore/Rollback support
- ✅ Download specific versions
### Phase 7: Search & Discovery (Planned)
- 🔄 Full-text search trong metadata
- 🔄 Tag-based filtering
- 🔄 Advanced search queries
---