# smart-storage **Repository Path**: hubert_rust/smart-storage ## Basic Information - **Project Name**: smart-storage - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-28 - **Last Updated**: 2026-06-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # smart-storage Smart AI 资源存储模块(从 smart-cluster 上传功能迁移),作为 **Go 子模块** 由 `smart-ai` 引用,HTTP 前缀 **`/api/resource`**。 ## 目录结构 ``` smart-storage/ ├── register.go # Register(api) → /api/resource/* ├── deps.go # NewDeps(db, apiBase) ├── handler/ # HTTP 处理器 ├── service/ # 分片上传、秒传、资源树 ├── repository/ # res_upload_tasks / res_upload_chunks / res_resources / res_storage_configs ├── model/ # GORM 模型 ├── objectstore/ # local / MinIO(S3) / 腾讯云 COS ├── storagesettings/ # 存储配置 CRUD ├── authz/catalog.yaml # IAM 鉴权目录 └── migrations/ # 001_res_*.sql → version smart-storage/res_* ``` ## API(apiBase = `http://host/api/resource`) | 方法 | 路径 | 说明 | |------|------|------| | POST | `/api/resource/init` | 初始化分片上传 | | POST | `/api/resource/chunk` | 上传分片 | | POST | `/api/resource/complete` | 完成合并 | | POST | `/api/resource/cancel` | 取消 | | GET | `/api/resource/status` | 查询进度 | | POST | `/api/resource/simple` | 小文件直传 | | GET | `/api/resource/resources` | 资源列表 | | * | `/api/resource/storage/*` | 存储配置管理 | ## 前端 SDK `smart-ai/web-front/apps/upload-sdk` 中设置: ```js apiBase: '/api/resource' ``` ## 集成(smart-ai) - `go.mod`: `replace smart-storage => ../smart-storage` - `bootstrap.Run`: `smartstorage.NewDeps(ctx, db, apiBase)` - `router.Register`: `smartstorage.Register(api, deps)`