1462 lines
40 KiB
YAML
1462 lines
40 KiB
YAML
openapi: 3.0.3
|
||
info:
|
||
title: Data Management Service API
|
||
description: |
|
||
数据管理服务API,提供数据集的创建、管理和文件操作功能。
|
||
|
||
主要功能:
|
||
- 数据集的创建和管理
|
||
- 多种数据集类型支持(图像、文本、音频、视频、多模态等)
|
||
- 数据集文件管理
|
||
- 数据集标签和元数据管理
|
||
- 数据集统计信息
|
||
version: 1.0.0
|
||
|
||
servers:
|
||
- url: http://localhost:8092/api/data-management
|
||
description: Development server
|
||
|
||
tags:
|
||
- name: Dataset
|
||
description: 数据集管理
|
||
- name: DatasetFile
|
||
description: 数据集文件管理
|
||
- name: DatasetType
|
||
description: 数据集类型管理
|
||
- name: Tag
|
||
description: 标签管理
|
||
|
||
paths:
|
||
/api/data-management/datasets:
|
||
get:
|
||
tags: [Dataset]
|
||
operationId: getDatasets
|
||
summary: 获取数据集列表
|
||
description: 分页查询数据集列表,支持按类型、标签等条件筛选
|
||
parameters:
|
||
- name: page
|
||
in: query
|
||
schema:
|
||
type: integer
|
||
default: 0
|
||
description: 页码,从1开始
|
||
- name: size
|
||
in: query
|
||
schema:
|
||
type: integer
|
||
default: 20
|
||
description: 每页大小
|
||
- name: type
|
||
in: query
|
||
schema:
|
||
type: string
|
||
description: 数据集类型过滤
|
||
- name: tags
|
||
in: query
|
||
schema:
|
||
type: string
|
||
description: 标签过滤,多个标签用逗号分隔
|
||
- name: keyword
|
||
in: query
|
||
schema:
|
||
type: string
|
||
description: 关键词搜索(名称、描述)
|
||
- name: status
|
||
in: query
|
||
schema:
|
||
type: string
|
||
enum: [DRAFT, ACTIVE, PROCESSING, ARCHIVED, PUBLISHED, DEPRECATED]
|
||
description: 数据集状态过滤
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/PagedDatasetResponse'
|
||
'400':
|
||
description: 请求参数错误
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
post:
|
||
tags: [Dataset]
|
||
operationId: createDataset
|
||
summary: 创建数据集
|
||
description: 创建新的数据集
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CreateDatasetRequest'
|
||
responses:
|
||
'200':
|
||
description: 创建成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/DatasetResponse'
|
||
|
||
/api/data-management/datasets/{datasetId}:
|
||
get:
|
||
tags: [Dataset]
|
||
operationId: getDatasetById
|
||
summary: 获取数据集详情
|
||
description: 根据ID获取数据集详细信息
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/DatasetResponse'
|
||
'404':
|
||
description: 数据集不存在
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
put:
|
||
tags: [Dataset]
|
||
summary: 更新数据集
|
||
operationId: updateDataset
|
||
description: 更新数据集信息
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/UpdateDatasetRequest'
|
||
responses:
|
||
'200':
|
||
description: 更新成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/DatasetResponse'
|
||
'404':
|
||
description: 数据集不存在
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
delete:
|
||
tags: [Dataset]
|
||
operationId: deleteDataset
|
||
summary: 删除数据集
|
||
description: 删除指定的数据集
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
responses:
|
||
'204':
|
||
description: 删除成功
|
||
'404':
|
||
description: 数据集不存在
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
/api/data-management/datasets/{datasetId}/files:
|
||
get:
|
||
tags: [DatasetFile]
|
||
summary: 获取数据集文件列表
|
||
operationId: getDatasetFiles
|
||
description: 分页获取数据集中的文件列表
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
- name: isWithDirectory
|
||
in: query
|
||
schema:
|
||
type: boolean
|
||
default: false
|
||
description: 是否包含目录结构
|
||
- name: page
|
||
in: query
|
||
schema:
|
||
type: integer
|
||
default: 0
|
||
description: 页码,从0开始
|
||
- name: size
|
||
in: query
|
||
schema:
|
||
type: integer
|
||
default: 20
|
||
description: 每页大小
|
||
- name: prefix
|
||
in: query
|
||
schema:
|
||
type: string
|
||
default: ""
|
||
description: 路径前缀,用于过滤子目录下的文件
|
||
- name: fileType
|
||
in: query
|
||
schema:
|
||
type: string
|
||
description: 文件类型过滤
|
||
- name: status
|
||
in: query
|
||
schema:
|
||
type: string
|
||
enum: [UPLOADED, PROCESSING, COMPLETED, ERROR]
|
||
description: 文件状态过滤
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/PagedDatasetFileResponseWrapper'
|
||
|
||
/api/data-management/datasets/{datasetId}/files/directories:
|
||
post:
|
||
tags: [ DatasetFile ]
|
||
operationId: createDirectory
|
||
summary: 在数据集下创建子目录
|
||
description: 在指定数据集下的某个前缀路径中创建一个新的子目录
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CreateDirectoryRequest'
|
||
responses:
|
||
'200':
|
||
description: 创建成功
|
||
|
||
/api/data-management/datasets/{datasetId}/files/{fileId}:
|
||
get:
|
||
tags: [DatasetFile]
|
||
summary: 获取文件详情
|
||
description: 获取数据集中指定文件的详细信息
|
||
operationId: getDatasetFileById
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
- name: fileId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 文件ID
|
||
- name: prefix
|
||
in: query
|
||
schema:
|
||
type: string
|
||
default: ""
|
||
description: 路径前缀,用于定位文件
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/DatasetFileResponseWrapper'
|
||
'404':
|
||
description: 文件不存在
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
delete:
|
||
tags: [DatasetFile]
|
||
summary: 删除文件
|
||
operationId: deleteDatasetFile
|
||
description: 从数据集中删除指定文件
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
- name: fileId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 文件ID
|
||
- name: prefix
|
||
in: query
|
||
schema:
|
||
type: string
|
||
default: ""
|
||
description: 路径前缀,用于定位文件
|
||
responses:
|
||
'200':
|
||
description: 删除成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
'404':
|
||
description: 文件不存在
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
/api/data-management/datasets/{datasetId}/files/{fileId}/download:
|
||
get:
|
||
tags: [DatasetFile]
|
||
operationId: downloadDatasetFile
|
||
summary: 下载文件
|
||
description: 下载数据集中的指定文件
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
- name: fileId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 文件ID
|
||
responses:
|
||
'200':
|
||
description: 文件内容
|
||
content:
|
||
application/octet-stream:
|
||
schema:
|
||
type: string
|
||
format: binary
|
||
|
||
/api/data-management/datasets/{datasetId}/files/download:
|
||
get:
|
||
tags: [ DatasetFile ]
|
||
operationId: downloadDatasetFileAsZip
|
||
summary: 下载文件
|
||
description: 下载数据集中全部文件
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
responses:
|
||
'200':
|
||
description: 文件内容
|
||
content:
|
||
application/octet-stream:
|
||
schema:
|
||
type: string
|
||
format: binary
|
||
|
||
/api/data-management/datasets/{datasetId}/files/directories/download:
|
||
get:
|
||
tags: [DatasetFile]
|
||
operationId: downloadDirectory
|
||
summary: 下载目录
|
||
description: 下载指定目录(压缩为 ZIP)
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
- name: prefix
|
||
in: query
|
||
schema:
|
||
type: string
|
||
default: ""
|
||
description: 目录前缀路径
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/zip:
|
||
schema:
|
||
type: string
|
||
format: binary
|
||
|
||
delete:
|
||
tags: [DatasetFile]
|
||
operationId: deleteDirectory
|
||
summary: 删除目录
|
||
description: 删除目录及其所有内容
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
- name: prefix
|
||
in: query
|
||
schema:
|
||
type: string
|
||
default: ""
|
||
description: 目录前缀路径
|
||
responses:
|
||
'200':
|
||
description: 删除成功
|
||
|
||
put:
|
||
tags: [DatasetFile]
|
||
operationId: renameDirectory
|
||
summary: 重命名目录
|
||
description: 重命名数据集目录
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/RenameDirectoryRequest'
|
||
responses:
|
||
'200':
|
||
description: 重命名成功
|
||
|
||
/api/data-management/datasets/{datasetId}/files/{fileId}/rename:
|
||
put:
|
||
tags: [DatasetFile]
|
||
operationId: renameFile
|
||
summary: 重命名文件
|
||
description: 重命名数据集文件
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
- name: fileId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 文件ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/RenameFileRequest'
|
||
responses:
|
||
'200':
|
||
description: 重命名成功
|
||
|
||
/api/data-management/datasets/{datasetId}/files/upload/add:
|
||
post:
|
||
tags: [ DatasetFile ]
|
||
operationId: addFilesToDataset
|
||
summary: 添加文件到数据集(仅创建数据库记录)
|
||
description: 将指定源文件路径列表添加到数据集,仅在数据库中创建记录,不执行物理文件系统操作。
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/AddFilesRequest'
|
||
responses:
|
||
'200':
|
||
description: 添加成功,返回创建的文件记录列表
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: array
|
||
items:
|
||
$ref: '#/components/schemas/DatasetFileResponse'
|
||
|
||
/api/data-management/datasets/{datasetId}/files/upload/copy:
|
||
post:
|
||
tags: [DatasetFile]
|
||
operationId: copyFilesToDataset
|
||
summary: 拷贝文件到数据集
|
||
description: 将指定路径中的文件拷贝到数据集目录下
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CopyFilesRequest'
|
||
responses:
|
||
'200':
|
||
description: 拷贝成功,返回创建的文件记录列表
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: array
|
||
items:
|
||
$ref: '#/components/schemas/DatasetFileResponse'
|
||
|
||
/api/data-management/datasets/{datasetId}/files/upload/pre-upload:
|
||
post:
|
||
tags: [ DatasetFile ]
|
||
operationId: preUpload
|
||
summary: 切片上传预上传
|
||
description: 预上传接口,返回后续分片上传所需的请求ID
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/UploadFilesPreRequest'
|
||
responses:
|
||
'200':
|
||
description: 预上传成功,返回请求ID
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/StringResponseWrapper'
|
||
|
||
/api/data-management/datasets/{datasetId}/files/upload/chunk:
|
||
post:
|
||
tags: [ DatasetFile ]
|
||
operationId: chunkUpload
|
||
summary: 切片上传
|
||
description: 使用预上传返回的请求ID进行分片上传
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
multipart/form-data:
|
||
schema:
|
||
$ref: '#/components/schemas/UploadFileRequest'
|
||
responses:
|
||
'200':
|
||
description: 上传成功
|
||
|
||
/api/data-management/dataset-types:
|
||
get:
|
||
operationId: getDatasetTypes
|
||
tags: [DatasetType]
|
||
summary: 获取数据集类型列表
|
||
description: 获取所有支持的数据集类型
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
type: array
|
||
items:
|
||
$ref: '#/components/schemas/DatasetTypeResponse'
|
||
|
||
/api/data-management/tags:
|
||
get:
|
||
tags: [Tag]
|
||
operationId: getTags
|
||
summary: 获取标签列表
|
||
description: 获取所有可用的标签
|
||
parameters:
|
||
- name: keyword
|
||
in: query
|
||
schema:
|
||
type: string
|
||
description: 标签名称关键词搜索
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/TagListResponse'
|
||
|
||
post:
|
||
tags: [Tag]
|
||
operationId: createTag
|
||
summary: 创建标签
|
||
description: 创建新的标签
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/CreateTagRequest'
|
||
responses:
|
||
'200':
|
||
description: 创建成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/TagResponseWrapper'
|
||
'400':
|
||
description: 请求参数错误
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
put:
|
||
tags: [Tag]
|
||
operationId: updateTag
|
||
summary: 更新标签
|
||
description: 更新现有标签信息
|
||
requestBody:
|
||
required: true
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/UpdateTagRequest'
|
||
responses:
|
||
'200':
|
||
description: 更新成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/TagResponseWrapper'
|
||
|
||
delete:
|
||
tags: [Tag]
|
||
operationId: deleteTag
|
||
summary: 删除标签
|
||
description: 删除指定的标签(批量删除)
|
||
parameters:
|
||
- name: ids
|
||
in: query
|
||
required: true
|
||
schema:
|
||
type: array
|
||
items:
|
||
type: string
|
||
maxItems: 10
|
||
description: 标签ID列表,最多10个
|
||
style: form
|
||
explode: false
|
||
responses:
|
||
'200':
|
||
description: 删除成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
'400':
|
||
description: 请求参数错误
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
/api/data-management/datasets/{datasetId}/lineage:
|
||
get:
|
||
tags: [Dataset]
|
||
operationId: getDatasetLineage
|
||
summary: 获取数据集血缘信息
|
||
description: 获取数据集的血缘关系信息
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
format: uuid
|
||
description: 数据集ID
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/DatasetLineage'
|
||
'404':
|
||
description: 数据集不存在
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
/api/data-management/datasets/{datasetId}/statistics:
|
||
get:
|
||
tags: [Dataset]
|
||
operationId: getDatasetStatistics
|
||
summary: 获取数据集统计信息
|
||
description: 获取数据集的统计信息(文件数量、大小、完成度等)
|
||
parameters:
|
||
- name: datasetId
|
||
in: path
|
||
required: true
|
||
schema:
|
||
type: string
|
||
description: 数据集ID
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/DatasetStatisticsResponseWrapper'
|
||
'404':
|
||
description: 数据集不存在
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/ErrorResponse'
|
||
|
||
/api/data-management/datasets/statistics:
|
||
get:
|
||
tags: [Dataset]
|
||
operationId: getAllDatasetStatistics
|
||
summary: 获取所有数据集统计信息
|
||
description: 获取所有数据集的统计信息汇总
|
||
responses:
|
||
'200':
|
||
description: 成功
|
||
content:
|
||
application/json:
|
||
schema:
|
||
$ref: '#/components/schemas/AllDatasetStatisticsResponseWrapper'
|
||
|
||
components:
|
||
schemas:
|
||
PagedDatasetResponse:
|
||
type: object
|
||
properties:
|
||
content:
|
||
type: array
|
||
items:
|
||
$ref: '#/components/schemas/DatasetResponse'
|
||
page:
|
||
type: integer
|
||
description: 当前页码
|
||
size:
|
||
type: integer
|
||
description: 每页大小
|
||
totalElements:
|
||
type: integer
|
||
description: 总元素数
|
||
totalPages:
|
||
type: integer
|
||
description: 总页数
|
||
first:
|
||
type: boolean
|
||
description: 是否为第一页
|
||
last:
|
||
type: boolean
|
||
description: 是否为最后一页
|
||
number:
|
||
type: integer
|
||
description: 页码
|
||
|
||
DatasetResponse:
|
||
type: object
|
||
properties:
|
||
id:
|
||
type: string
|
||
description: 数据集ID
|
||
name:
|
||
type: string
|
||
description: 数据集名称
|
||
description:
|
||
type: string
|
||
description: 数据集描述
|
||
datasetType:
|
||
type: string
|
||
description: 数据集类型
|
||
status:
|
||
type: string
|
||
description: 数据集状态
|
||
tags:
|
||
type: array
|
||
items:
|
||
$ref: '#/components/schemas/TagResponse'
|
||
description: 标签列表
|
||
retentionDays:
|
||
type: integer
|
||
description: 数据集保留天数
|
||
dataSource:
|
||
type: string
|
||
description: 数据源
|
||
targetLocation:
|
||
type: string
|
||
description: 目标位置
|
||
fileCount:
|
||
type: integer
|
||
description: 文件数量
|
||
totalSize:
|
||
type: integer
|
||
format: int64
|
||
description: 总大小(字节)
|
||
completionRate:
|
||
type: number
|
||
format: float
|
||
description: 完成率(0-100)
|
||
createdAt:
|
||
type: string
|
||
format: date-time
|
||
description: 创建时间
|
||
updatedAt:
|
||
type: string
|
||
format: date-time
|
||
description: 更新时间
|
||
createdBy:
|
||
type: string
|
||
description: 创建者
|
||
updatedBy:
|
||
type: string
|
||
description: 更新者
|
||
distribution:
|
||
type: object
|
||
additionalProperties:
|
||
type: object
|
||
additionalProperties:
|
||
type: integer
|
||
format: int64
|
||
description: 分布信息
|
||
pvcName:
|
||
type: string
|
||
description: 数据集pvc名称
|
||
|
||
CreateDatasetRequest:
|
||
type: object
|
||
required:
|
||
- name
|
||
- datasetType
|
||
properties:
|
||
name:
|
||
type: string
|
||
description: 数据集名称
|
||
minLength: 1
|
||
maxLength: 255
|
||
description:
|
||
type: string
|
||
description: 数据集描述
|
||
maxLength: 500
|
||
datasetType:
|
||
type: string
|
||
description: 数据集类型,取值范围为TEXT/IMAGE/VIDEO/AUDIO/OTHER
|
||
enum: [TEXT, IMAGE, VIDEO, AUDIO, OTHER]
|
||
tags:
|
||
type: array
|
||
items:
|
||
type: string
|
||
description: 标签列表
|
||
maxItems: 20
|
||
dataSource:
|
||
type: string
|
||
description: 数据源
|
||
maxLength: 255
|
||
retentionDays:
|
||
type: integer
|
||
description: 保留天数
|
||
minimum: 0
|
||
status:
|
||
type: string
|
||
enum: [DRAFT, ACTIVE, PROCESSING, ARCHIVED, PUBLISHED, DEPRECATED]
|
||
description: 数据集状态
|
||
|
||
UpdateDatasetRequest:
|
||
type: object
|
||
required:
|
||
- name
|
||
properties:
|
||
name:
|
||
type: string
|
||
description: 数据集名称
|
||
maxLength: 255
|
||
description:
|
||
type: string
|
||
description: 数据集描述
|
||
maxLength: 500
|
||
dataSource:
|
||
type: string
|
||
description: 数据源
|
||
maxLength: 255
|
||
tags:
|
||
type: array
|
||
items:
|
||
type: string
|
||
description: 标签列表
|
||
maxItems: 20
|
||
status:
|
||
type: string
|
||
enum: [DRAFT, ACTIVE, PROCESSING, ARCHIVED, PUBLISHED, DEPRECATED]
|
||
description: 数据集状态
|
||
|
||
UploadFilesPreRequest:
|
||
type: object
|
||
description: 切片上传预上传请求
|
||
properties:
|
||
hasArchive:
|
||
type: boolean
|
||
description: 是否为压缩包上传
|
||
default: false
|
||
totalFileNum:
|
||
type: integer
|
||
format: int32
|
||
minimum: 1
|
||
description: 总文件数量
|
||
totalSize:
|
||
type: integer
|
||
format: int64
|
||
minimum: 1
|
||
description: 总文件大小(字节)
|
||
prefix:
|
||
type: string
|
||
description: 目标子目录前缀,例如 "images/",为空表示数据集根目录
|
||
maxLength: 500
|
||
required: [ totalFileNum ]
|
||
|
||
AddFilesRequest:
|
||
type: object
|
||
description: 将源文件路径添加到数据集的请求
|
||
properties:
|
||
files:
|
||
type: array
|
||
description: 文件列表
|
||
items:
|
||
$ref: '#/components/schemas/FileRequest'
|
||
minItems: 1
|
||
maxItems: 1000
|
||
softAdd:
|
||
type: boolean
|
||
description: 如果为 true,则仅在数据库中创建记录(默认 false)
|
||
default: false
|
||
prefix:
|
||
type: string
|
||
description: 目标子目录前缀
|
||
maxLength: 500
|
||
default: ""
|
||
required:
|
||
- files
|
||
|
||
FileRequest:
|
||
type: object
|
||
description: 文件请求对象
|
||
properties:
|
||
filePath:
|
||
type: string
|
||
description: 文件路径
|
||
maxLength: 1000
|
||
metadata:
|
||
type: object
|
||
additionalProperties: true
|
||
description: 文件元数据
|
||
required:
|
||
- filePath
|
||
|
||
CreateDirectoryRequest:
|
||
type: object
|
||
description: 创建数据集子目录请求
|
||
required:
|
||
- directoryName
|
||
properties:
|
||
parentPrefix:
|
||
type: string
|
||
description: 父级前缀路径,例如 "images/",为空表示数据集根目录
|
||
directoryName:
|
||
type: string
|
||
description: 新建目录名称
|
||
maxLength: 255
|
||
|
||
UploadFileRequest:
|
||
type: object
|
||
description: 分片上传请求
|
||
properties:
|
||
reqId:
|
||
type: string
|
||
description: 预上传返回的请求ID
|
||
fileNo:
|
||
type: integer
|
||
format: int32
|
||
description: 文件编号(批量中的第几个)
|
||
minimum: 0
|
||
fileName:
|
||
type: string
|
||
description: 文件名称
|
||
maxLength: 255
|
||
totalChunkNum:
|
||
type: integer
|
||
format: int32
|
||
description: 文件总分片数量
|
||
minimum: 1
|
||
chunkNo:
|
||
type: integer
|
||
format: int32
|
||
description: 当前分片编号(从1开始)
|
||
minimum: 1
|
||
file:
|
||
type: string
|
||
format: binary
|
||
description: 分片二进制内容
|
||
checkSumHex:
|
||
type: string
|
||
description: 分片校验和(十六进制字符串,64位)
|
||
pattern: '^[0-9a-fA-F]{64}$'
|
||
required: [ reqId, fileNo, fileName, totalChunkNum, chunkNo, file ]
|
||
|
||
DatasetTypeResponse:
|
||
type: object
|
||
properties:
|
||
code:
|
||
type: string
|
||
description: 类型编码
|
||
name:
|
||
type: string
|
||
description: 类型名称
|
||
description:
|
||
type: string
|
||
description: 类型描述
|
||
supportedFormats:
|
||
type: array
|
||
items:
|
||
type: string
|
||
description: 支持的文件格式
|
||
icon:
|
||
type: string
|
||
description: 图标
|
||
|
||
PagedDatasetFileResponse:
|
||
type: object
|
||
properties:
|
||
content:
|
||
type: array
|
||
items:
|
||
$ref: '#/components/schemas/DatasetFileResponse'
|
||
page:
|
||
type: integer
|
||
description: 当前页码
|
||
size:
|
||
type: integer
|
||
description: 每页大小
|
||
totalElements:
|
||
type: integer
|
||
description: 总元素数
|
||
totalPages:
|
||
type: integer
|
||
description: 总页数
|
||
first:
|
||
type: boolean
|
||
description: 是否为第一页
|
||
last:
|
||
type: boolean
|
||
description: 是否为最后一页
|
||
number:
|
||
type: integer
|
||
description: 页码
|
||
|
||
DatasetFileResponse:
|
||
type: object
|
||
properties:
|
||
id:
|
||
type: string
|
||
description: 文件ID
|
||
fileName:
|
||
type: string
|
||
description: 文件名
|
||
originalName:
|
||
type: string
|
||
description: 原始文件名
|
||
fileType:
|
||
type: string
|
||
description: 文件类型
|
||
fileSize:
|
||
type: integer
|
||
format: int64
|
||
description: 文件大小(字节)
|
||
status:
|
||
type: string
|
||
enum: [UPLOADED, PROCESSING, COMPLETED, ERROR]
|
||
description: 文件状态
|
||
description:
|
||
type: string
|
||
description: 文件描述
|
||
filePath:
|
||
type: string
|
||
description: 文件路径
|
||
tags:
|
||
type: string
|
||
description: 文件标签(JSON 字符串)
|
||
tagsUpdatedAt:
|
||
type: string
|
||
format: date-time
|
||
description: 标签更新时间
|
||
metadata:
|
||
type: string
|
||
description: 文件元数据(包含标注信息等,JSON 字符串)
|
||
uploadTime:
|
||
type: string
|
||
format: date-time
|
||
description: 上传时间
|
||
lastAccessTime:
|
||
type: string
|
||
format: date-time
|
||
description: 最后更新时间
|
||
uploadedBy:
|
||
type: string
|
||
description: 上传者
|
||
directory:
|
||
type: boolean
|
||
description: 是否为目录
|
||
fileCount:
|
||
type: integer
|
||
format: int64
|
||
description: 目录文件数量
|
||
|
||
TagResponse:
|
||
type: object
|
||
properties:
|
||
id:
|
||
type: string
|
||
description: 标签ID
|
||
name:
|
||
type: string
|
||
description: 标签名称
|
||
color:
|
||
type: string
|
||
description: 标签颜色
|
||
description:
|
||
type: string
|
||
description: 标签描述
|
||
usageCount:
|
||
type: integer
|
||
description: 使用次数
|
||
category:
|
||
type: string
|
||
description: 标签分类
|
||
|
||
CreateTagRequest:
|
||
type: object
|
||
required:
|
||
- name
|
||
properties:
|
||
name:
|
||
type: string
|
||
description: 标签名称
|
||
minLength: 1
|
||
maxLength: 100
|
||
color:
|
||
type: string
|
||
description: 标签颜色
|
||
pattern: '^#[0-9A-Fa-f]{6}$'
|
||
description:
|
||
type: string
|
||
description: 标签描述
|
||
maxLength: 500
|
||
category:
|
||
type: string
|
||
description: 标签分类
|
||
maxLength: 50
|
||
|
||
DatasetStatisticsResponse:
|
||
type: object
|
||
properties:
|
||
totalFiles:
|
||
type: integer
|
||
description: 总文件数
|
||
completedFiles:
|
||
type: integer
|
||
description: 已完成文件数
|
||
totalSize:
|
||
type: integer
|
||
format: int64
|
||
description: 总大小(字节)
|
||
completionRate:
|
||
type: number
|
||
format: float
|
||
description: 完成率(0-100)
|
||
fileTypeDistribution:
|
||
type: object
|
||
additionalProperties:
|
||
type: integer
|
||
description: 文件类型分布
|
||
statusDistribution:
|
||
type: object
|
||
additionalProperties:
|
||
type: integer
|
||
description: 状态分布
|
||
|
||
ErrorResponse:
|
||
type: object
|
||
properties:
|
||
error:
|
||
type: string
|
||
description: 错误代码
|
||
message:
|
||
type: string
|
||
description: 错误消息
|
||
timestamp:
|
||
type: string
|
||
format: date-time
|
||
description: 错误时间
|
||
path:
|
||
type: string
|
||
description: 请求路径
|
||
|
||
CopyFilesRequest:
|
||
type: object
|
||
description: 拷贝文件到数据集的请求
|
||
properties:
|
||
sourcePaths:
|
||
type: array
|
||
items:
|
||
type: string
|
||
description: 源文件路径列表(相对或绝对路径),每个元素表示一个要添加的文件或目录路径
|
||
required:
|
||
- sourcePaths
|
||
|
||
UpdateTagRequest:
|
||
type: object
|
||
description: 更新标签请求
|
||
required:
|
||
- id
|
||
properties:
|
||
id:
|
||
type: string
|
||
description: 标签ID
|
||
name:
|
||
type: string
|
||
description: 标签名称
|
||
maxLength: 100
|
||
color:
|
||
type: string
|
||
description: 标签颜色,十六进制格式
|
||
pattern: '^#[0-9A-Fa-f]{6}$'
|
||
description:
|
||
type: string
|
||
description: 标签描述
|
||
maxLength: 500
|
||
|
||
RenameFileRequest:
|
||
type: object
|
||
description: 重命名数据集文件请求
|
||
required:
|
||
- newName
|
||
properties:
|
||
newName:
|
||
type: string
|
||
description: 新的文件名称(不包含后缀)
|
||
maxLength: 255
|
||
|
||
RenameDirectoryRequest:
|
||
type: object
|
||
description: 重命名数据集目录请求
|
||
required:
|
||
- prefix
|
||
- newName
|
||
properties:
|
||
prefix:
|
||
type: string
|
||
description: 目录前缀,例如 "images/",与列表/删除目录接口保持一致
|
||
maxLength: 500
|
||
newName:
|
||
type: string
|
||
description: 新的目录名称
|
||
maxLength: 255
|
||
|
||
DatasetLineage:
|
||
type: object
|
||
description: 数据集血缘信息
|
||
properties:
|
||
upstreamDatasets:
|
||
type: array
|
||
description: 上游数据集
|
||
items:
|
||
$ref: '#/components/schemas/DatasetResponse'
|
||
downstreamDatasets:
|
||
type: array
|
||
description: 下游数据集
|
||
items:
|
||
$ref: '#/components/schemas/DatasetResponse'
|
||
tasks:
|
||
type: array
|
||
description: 相关任务
|
||
items:
|
||
type: object
|
||
properties:
|
||
id:
|
||
type: string
|
||
name:
|
||
type: string
|
||
type:
|
||
type: string
|
||
|
||
AllDatasetStatisticsResponse:
|
||
type: object
|
||
description: 所有数据集统计信息汇总
|
||
properties:
|
||
totalDatasets:
|
||
type: integer
|
||
description: 总数据集数量
|
||
totalFiles:
|
||
type: integer
|
||
description: 总文件数量
|
||
totalSize:
|
||
type: integer
|
||
format: int64
|
||
description: 总大小(字节)
|
||
datasetsByType:
|
||
type: object
|
||
additionalProperties:
|
||
type: integer
|
||
description: 按类型分组的统计
|
||
datasetsByStatus:
|
||
type: object
|
||
additionalProperties:
|
||
type: integer
|
||
description: 按状态分组的统计
|
||
|
||
TagListResponse:
|
||
type: object
|
||
description: 标签列表响应
|
||
properties:
|
||
code:
|
||
type: integer
|
||
description: 响应代码
|
||
message:
|
||
type: string
|
||
description: 响应消息
|
||
data:
|
||
type: array
|
||
items:
|
||
$ref: '#/components/schemas/TagResponse'
|
||
description: 标签列表
|
||
|
||
DatasetStatisticsResponseWrapper:
|
||
type: object
|
||
description: 数据集统计信息响应包装器
|
||
properties:
|
||
code:
|
||
type: integer
|
||
description: 响应代码
|
||
message:
|
||
type: string
|
||
description: 响应消息
|
||
data:
|
||
$ref: '#/components/schemas/DatasetStatisticsResponse'
|
||
|
||
AllDatasetStatisticsResponseWrapper:
|
||
type: object
|
||
description: 所有数据集统计信息响应包装器
|
||
properties:
|
||
code:
|
||
type: integer
|
||
description: 响应代码
|
||
message:
|
||
type: string
|
||
description: 响应消息
|
||
data:
|
||
$ref: '#/components/schemas/AllDatasetStatisticsResponse'
|
||
|
||
PagedDatasetFileResponseWrapper:
|
||
type: object
|
||
description: 数据集文件分页响应包装器
|
||
properties:
|
||
code:
|
||
type: integer
|
||
description: 响应代码
|
||
message:
|
||
type: string
|
||
description: 响应消息
|
||
data:
|
||
$ref: '#/components/schemas/PagedDatasetFileResponse'
|
||
|
||
DatasetFileResponseWrapper:
|
||
type: object
|
||
description: 数据集文件响应包装器
|
||
properties:
|
||
code:
|
||
type: integer
|
||
description: 响应代码
|
||
message:
|
||
type: string
|
||
description: 响应消息
|
||
data:
|
||
$ref: '#/components/schemas/DatasetFileResponse'
|
||
|
||
StringResponseWrapper:
|
||
type: object
|
||
description: 字符串响应包装器
|
||
properties:
|
||
code:
|
||
type: integer
|
||
description: 响应代码
|
||
message:
|
||
type: string
|
||
description: 响应消息
|
||
data:
|
||
type: string
|
||
description: 响应数据
|
||
|
||
TagResponseWrapper:
|
||
type: object
|
||
description: 标签响应包装器
|
||
properties:
|
||
code:
|
||
type: integer
|
||
description: 响应代码
|
||
message:
|
||
type: string
|
||
description: 响应消息
|
||
data:
|
||
$ref: '#/components/schemas/TagResponse'
|