diff --git a/wangpan-common/target/classes/com/wangpan/common/dal/dataobject/DriveDO.class b/wangpan-common/target/classes/com/wangpan/common/dal/dataobject/DriveDO.class index 23f4241..e69fd50 100644 Binary files a/wangpan-common/target/classes/com/wangpan/common/dal/dataobject/DriveDO.class and b/wangpan-common/target/classes/com/wangpan/common/dal/dataobject/DriveDO.class differ diff --git a/wangpan-common/target/classes/com/wangpan/common/dal/repository/DriveRepository.class b/wangpan-common/target/classes/com/wangpan/common/dal/repository/DriveRepository.class index 468b0fc..e4eec7d 100644 Binary files a/wangpan-common/target/classes/com/wangpan/common/dal/repository/DriveRepository.class and b/wangpan-common/target/classes/com/wangpan/common/dal/repository/DriveRepository.class differ diff --git a/wangpan-common/target/classes/com/wangpan/common/entity/Drive.class b/wangpan-common/target/classes/com/wangpan/common/entity/Drive.class index 3a92936..c0e8edd 100644 Binary files a/wangpan-common/target/classes/com/wangpan/common/entity/Drive.class and b/wangpan-common/target/classes/com/wangpan/common/entity/Drive.class differ diff --git a/wangpan-common/target/classes/com/wangpan/common/util/OpenListClient.class b/wangpan-common/target/classes/com/wangpan/common/util/OpenListClient.class index 6d004b1..6f108e9 100644 Binary files a/wangpan-common/target/classes/com/wangpan/common/util/OpenListClient.class and b/wangpan-common/target/classes/com/wangpan/common/util/OpenListClient.class differ diff --git a/wangpan-gateway/src/main/resources/META-INF/resources/api-doc.html b/wangpan-gateway/src/main/resources/META-INF/resources/api-doc.html index 76cabd7..0bb6822 100644 --- a/wangpan-gateway/src/main/resources/META-INF/resources/api-doc.html +++ b/wangpan-gateway/src/main/resources/META-INF/resources/api-doc.html @@ -300,6 +300,7 @@ + @@ -339,6 +340,17 @@
TMDB:8083
+
+ + + + +
Drive:8082
+ +
OpenList:13000
+ +
各网盘
+
@@ -350,6 +362,8 @@ /api/users/**user-service用户管理 /api/profile/**user-service个人资料 /api/drive/**drive-service网盘管理 + /api/drive/**/sync-filesdrive-serviceOpenList 文件同步 + /api/drive/**/play-urldrive-serviceOpenList 播放链接 /api/icon/**drive-serviceIcon管理 /api/movies/**tmdb-service电影管理 /api/tmdb/**, /api/tmdb-scraper/**tmdb-serviceTMDB刮削 @@ -3480,6 +3494,361 @@
+ +
+
+

OpenList 多网盘聚合服务

+ wangpan-drive-service : 8082 · 依赖 OpenList 服务 (http://ldfun.asia:13000) +
+ +
+

功能说明

+

+ OpenList 集成模块将 OpenList 作为多网盘聚合后端,支持 80+ 种网盘服务(阿里云盘、百度网盘、UC网盘、OneDrive 等)。 + Java 服务负责业务逻辑(用户、权限、TMDB 刮削),OpenList 负责文件操作(上传、下载、预览)。 +

+
+
+
前端
+ +
Gateway:8888
+ +
Drive:8082
+ +
OpenList:13000
+ +
各网盘
+
+
+
+ +
+

前置配置

+

+ 1. 在 OpenList 管理后台 (http://ldfun.asia:13000/@manage) 添加网盘存储
+ 2. 记录存储的 挂载路径(如 /uc)和 存储 ID(通过 API 获取)
+ 3. 在 application.yml 中配置 OpenList 服务地址和账号密码
+ 4. 创建网盘时传入 openlistStorageIdopenlistMountPath 关联 OpenList 存储 +

+
+ + +
+
+ POST + /api/drive + 创建网盘(关联 OpenList 存储) + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token> +Content-Type: application/json
+
+
+

请求体

+
{ + "name": "UC网盘电影库", + "description": "UC网盘存储", + "openlistStorageId": "1", + "openlistMountPath": "/uc" +}
+
+
+

字段说明

+ + + + + + +
字段类型必填说明
nameString网盘名称
descriptionString网盘描述
openlistStorageIdStringOpenList 存储 ID(不传则仅记录元数据)
openlistMountPathStringOpenList 挂载路径(如 "/uc")
+
+
+

成功响应示例

+
{ + "code": 200, + "message": "创建成功", + "data": { + "id": 1, + "name": "UC网盘电影库", + "description": "UC网盘存储", + "openlistStorageId": "1", + "openlistMountPath": "/uc", + "folderCount": 0, + "fileCount": 0, + "totalSize": 0, + "status": "active", + "createTime": "2026-06-26T15:00:00", + "updateTime": "2026-06-26T15:00:00" + } +}
+
+
+

失败响应示例

+
{ + "code": 400, + "message": "创建网盘失败:网盘名称不能为空", + "data": null +}
+
+
+
+ + +
+
+ POST + /api/drive/{driveId}/folders/{folderId}/sync-files + 从 OpenList 同步文件夹文件 + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

路径参数

+ + + + +
参数类型说明
driveIdLong网盘 ID
folderIdLong文件夹 ID(0 表示根目录)
+
+
+

功能说明

+

+ 调用 OpenList API 获取指定路径下的文件列表,自动创建数据库中缺失的电影记录。 + 已存在的文件不会重复创建。同步后文件可进行 TMDB 刮削。 +

+
+
+

成功响应示例

+
{ + "code": 200, + "message": "同步成功", + "data": { + "syncCount": 5, + "totalFiles": 10 + } +}
+
+
+

响应字段说明

+ + + + +
字段说明
syncCount本次新增的电影记录数量
totalFilesOpenList 中该路径下的文件总数
+
+
+

失败响应示例

+
{ + "code": 400, + "message": "同步失败:网盘未关联 OpenList 存储", + "data": null +}
+
+
+
+ + +
+
+ GET + /api/drive/{driveId}/movies/{movieId}/play-url + 获取电影真实播放链接 + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

路径参数

+ + + + +
参数类型说明
driveIdLong网盘 ID
movieIdLong电影 ID
+
+
+

功能说明

+

+ 调用 OpenList API 获取文件的真实下载地址,返回的 URL 可直接用于视频播放器播放。 + 仅支持 storageTypeopenlist 的电影记录。 +

+
+
+

成功响应示例

+
{ + "code": 200, + "message": "获取成功", + "data": { + "playUrl": "https://uc网盘真实下载地址/xxx.mp4", + "fileName": "阿凡达.mp4", + "fileSize": 1073741824 + } +}
+
+
+

响应字段说明

+ + + + + +
字段说明
playUrl真实播放/下载地址,可直接用于视频播放器
fileName文件名
fileSize文件大小(字节)
+
+
+

失败响应示例

+
{ + "code": 400, + "message": "获取失败:该电影不是 OpenList 管理的文件", + "data": null +}
+
+
+
+ + +
+
+ GET + /api/drive + 查看网盘列表(含 OpenList 信息) + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

成功响应示例

+
{ + "code": 200, + "data": [ + { + "id": 1, + "name": "UC网盘电影库", + "openlistStorageId": "1", + "openlistMountPath": "/uc", + "folderCount": 2, + "fileCount": 10, + "totalSize": 10737418240, + "status": "active" + } + ] +}
+
+
+

新增字段说明

+ + + + +
字段说明
openlistStorageId关联的 OpenList 存储 ID(null 表示未关联)
openlistMountPathOpenList 挂载路径(如 "/uc")
+
+
+
+ + +
+
+ GET + /api/drive/{driveId}/folders/{folderId}/movies + 查看电影列表(含 OpenList 信息) + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

路径参数

+ + + + +
参数类型说明
driveIdLong网盘 ID
folderIdLong文件夹 ID(0 表示根目录)
+
+
+

成功响应示例

+
{ + "code": 200, + "data": { + "list": [ + { + "id": 1, + "title": "阿凡达.mp4", + "openlistFilePath": "/uc/阿凡达.mp4", + "storageType": "openlist", + "fileSize": 1073741824, + "mimeType": "video/mp4" + } + ], + "total": 10, + "page": 1, + "pageSize": 20 + } +}
+
+
+

新增字段说明

+ + + + + +
字段说明
openlistFilePathOpenList 文件路径(如 "/uc/阿凡达.mp4")
storageType存储类型:metadata(仅元数据)/ openlist(OpenList 管理)
fileSize文件大小(字节)
+
+
+
+ + +
+

前端调用示例

+
+

创建网盘

+
const response = await fetch('/api/drive', { + method: 'POST', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + name: 'UC网盘电影库', + openlistStorageId: '1', + openlistMountPath: '/uc' + }) +});
+
+
+

同步文件

+
const response = await fetch(`/api/drive/${driveId}/folders/${folderId}/sync-files`, { + method: 'POST', + headers: { 'Authorization': `Bearer ${token}` } +}); +const data = await response.json(); +console.log(`同步了 ${data.data.syncCount} 个文件`);
+
+
+

播放视频

+
const response = await fetch(`/api/drive/${driveId}/movies/${movieId}/play-url`, { + headers: { 'Authorization': `Bearer ${token}` } +}); +const data = await response.json(); +videoPlayer.src = data.data.playUrl; // 直接设置视频源 +videoPlayer.play();
+
+
+
+
diff --git a/wangpan-gateway/target/classes/META-INF/resources/api-doc.html b/wangpan-gateway/target/classes/META-INF/resources/api-doc.html index 76cabd7..0bb6822 100644 --- a/wangpan-gateway/target/classes/META-INF/resources/api-doc.html +++ b/wangpan-gateway/target/classes/META-INF/resources/api-doc.html @@ -300,6 +300,7 @@ +
@@ -339,6 +340,17 @@
TMDB:8083
+
+ + + + +
Drive:8082
+ +
OpenList:13000
+ +
各网盘
+
@@ -350,6 +362,8 @@ /api/users/**user-service用户管理 /api/profile/**user-service个人资料 /api/drive/**drive-service网盘管理 + /api/drive/**/sync-filesdrive-serviceOpenList 文件同步 + /api/drive/**/play-urldrive-serviceOpenList 播放链接 /api/icon/**drive-serviceIcon管理 /api/movies/**tmdb-service电影管理 /api/tmdb/**, /api/tmdb-scraper/**tmdb-serviceTMDB刮削 @@ -3480,6 +3494,361 @@
+ +
+
+

OpenList 多网盘聚合服务

+ wangpan-drive-service : 8082 · 依赖 OpenList 服务 (http://ldfun.asia:13000) +
+ +
+

功能说明

+

+ OpenList 集成模块将 OpenList 作为多网盘聚合后端,支持 80+ 种网盘服务(阿里云盘、百度网盘、UC网盘、OneDrive 等)。 + Java 服务负责业务逻辑(用户、权限、TMDB 刮削),OpenList 负责文件操作(上传、下载、预览)。 +

+
+
+
前端
+ +
Gateway:8888
+ +
Drive:8082
+ +
OpenList:13000
+ +
各网盘
+
+
+
+ +
+

前置配置

+

+ 1. 在 OpenList 管理后台 (http://ldfun.asia:13000/@manage) 添加网盘存储
+ 2. 记录存储的 挂载路径(如 /uc)和 存储 ID(通过 API 获取)
+ 3. 在 application.yml 中配置 OpenList 服务地址和账号密码
+ 4. 创建网盘时传入 openlistStorageIdopenlistMountPath 关联 OpenList 存储 +

+
+ + +
+
+ POST + /api/drive + 创建网盘(关联 OpenList 存储) + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token> +Content-Type: application/json
+
+
+

请求体

+
{ + "name": "UC网盘电影库", + "description": "UC网盘存储", + "openlistStorageId": "1", + "openlistMountPath": "/uc" +}
+
+
+

字段说明

+ + + + + + +
字段类型必填说明
nameString网盘名称
descriptionString网盘描述
openlistStorageIdStringOpenList 存储 ID(不传则仅记录元数据)
openlistMountPathStringOpenList 挂载路径(如 "/uc")
+
+
+

成功响应示例

+
{ + "code": 200, + "message": "创建成功", + "data": { + "id": 1, + "name": "UC网盘电影库", + "description": "UC网盘存储", + "openlistStorageId": "1", + "openlistMountPath": "/uc", + "folderCount": 0, + "fileCount": 0, + "totalSize": 0, + "status": "active", + "createTime": "2026-06-26T15:00:00", + "updateTime": "2026-06-26T15:00:00" + } +}
+
+
+

失败响应示例

+
{ + "code": 400, + "message": "创建网盘失败:网盘名称不能为空", + "data": null +}
+
+
+
+ + +
+
+ POST + /api/drive/{driveId}/folders/{folderId}/sync-files + 从 OpenList 同步文件夹文件 + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

路径参数

+ + + + +
参数类型说明
driveIdLong网盘 ID
folderIdLong文件夹 ID(0 表示根目录)
+
+
+

功能说明

+

+ 调用 OpenList API 获取指定路径下的文件列表,自动创建数据库中缺失的电影记录。 + 已存在的文件不会重复创建。同步后文件可进行 TMDB 刮削。 +

+
+
+

成功响应示例

+
{ + "code": 200, + "message": "同步成功", + "data": { + "syncCount": 5, + "totalFiles": 10 + } +}
+
+
+

响应字段说明

+ + + + +
字段说明
syncCount本次新增的电影记录数量
totalFilesOpenList 中该路径下的文件总数
+
+
+

失败响应示例

+
{ + "code": 400, + "message": "同步失败:网盘未关联 OpenList 存储", + "data": null +}
+
+
+
+ + +
+
+ GET + /api/drive/{driveId}/movies/{movieId}/play-url + 获取电影真实播放链接 + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

路径参数

+ + + + +
参数类型说明
driveIdLong网盘 ID
movieIdLong电影 ID
+
+
+

功能说明

+

+ 调用 OpenList API 获取文件的真实下载地址,返回的 URL 可直接用于视频播放器播放。 + 仅支持 storageTypeopenlist 的电影记录。 +

+
+
+

成功响应示例

+
{ + "code": 200, + "message": "获取成功", + "data": { + "playUrl": "https://uc网盘真实下载地址/xxx.mp4", + "fileName": "阿凡达.mp4", + "fileSize": 1073741824 + } +}
+
+
+

响应字段说明

+ + + + + +
字段说明
playUrl真实播放/下载地址,可直接用于视频播放器
fileName文件名
fileSize文件大小(字节)
+
+
+

失败响应示例

+
{ + "code": 400, + "message": "获取失败:该电影不是 OpenList 管理的文件", + "data": null +}
+
+
+
+ + +
+
+ GET + /api/drive + 查看网盘列表(含 OpenList 信息) + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

成功响应示例

+
{ + "code": 200, + "data": [ + { + "id": 1, + "name": "UC网盘电影库", + "openlistStorageId": "1", + "openlistMountPath": "/uc", + "folderCount": 2, + "fileCount": 10, + "totalSize": 10737418240, + "status": "active" + } + ] +}
+
+
+

新增字段说明

+ + + + +
字段说明
openlistStorageId关联的 OpenList 存储 ID(null 表示未关联)
openlistMountPathOpenList 挂载路径(如 "/uc")
+
+
+
+ + +
+
+ GET + /api/drive/{driveId}/folders/{folderId}/movies + 查看电影列表(含 OpenList 信息) + 需Token +
+
+
+

请求头

+
Authorization: Bearer <token>
+
+
+

路径参数

+ + + + +
参数类型说明
driveIdLong网盘 ID
folderIdLong文件夹 ID(0 表示根目录)
+
+
+

成功响应示例

+
{ + "code": 200, + "data": { + "list": [ + { + "id": 1, + "title": "阿凡达.mp4", + "openlistFilePath": "/uc/阿凡达.mp4", + "storageType": "openlist", + "fileSize": 1073741824, + "mimeType": "video/mp4" + } + ], + "total": 10, + "page": 1, + "pageSize": 20 + } +}
+
+
+

新增字段说明

+ + + + + +
字段说明
openlistFilePathOpenList 文件路径(如 "/uc/阿凡达.mp4")
storageType存储类型:metadata(仅元数据)/ openlist(OpenList 管理)
fileSize文件大小(字节)
+
+
+
+ + +
+

前端调用示例

+
+

创建网盘

+
const response = await fetch('/api/drive', { + method: 'POST', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + name: 'UC网盘电影库', + openlistStorageId: '1', + openlistMountPath: '/uc' + }) +});
+
+
+

同步文件

+
const response = await fetch(`/api/drive/${driveId}/folders/${folderId}/sync-files`, { + method: 'POST', + headers: { 'Authorization': `Bearer ${token}` } +}); +const data = await response.json(); +console.log(`同步了 ${data.data.syncCount} 个文件`);
+
+
+

播放视频

+
const response = await fetch(`/api/drive/${driveId}/movies/${movieId}/play-url`, { + headers: { 'Authorization': `Bearer ${token}` } +}); +const data = await response.json(); +videoPlayer.src = data.data.playUrl; // 直接设置视频源 +videoPlayer.play();
+
+
+
+