init datamate

This commit is contained in:
Dallas98
2025-10-21 23:00:48 +08:00
commit 1c97afed7d
692 changed files with 135442 additions and 0 deletions

147
backend/openapi/README.md Normal file
View File

@@ -0,0 +1,147 @@
# OpenAPI Code Generation Configuration
# 基于YAML生成API代码的配置文件
## Maven Plugin Configuration for Spring Boot
# 在各个服务的pom.xml中添加以下插件配置:
```xml
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.6.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/../../openapi/specs/${project.artifactId}.yaml</inputSpec>
<generatorName>spring</generatorName>
<output>${project.build.directory}/generated-sources/openapi</output>
<apiPackage>com.datamate.${project.name}.interfaces.api</apiPackage>
<modelPackage>com.datamate.${project.name}.interfaces.dto</modelPackage>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<useTags>true</useTags>
<skipDefaultInterface>true</skipDefaultInterface>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
<java8>true</java8>
<dateLibrary>java8</dateLibrary>
<useBeanValidation>true</useBeanValidation>
<performBeanValidation>true</performBeanValidation>
<useSpringBoot3>true</useSpringBoot3>
<documentationProvider>springdoc</documentationProvider>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
```
## Gradle Plugin Configuration (Alternative)
# 如果使用Gradle,可以使用以下配置:
```gradle
plugins {
id 'org.openapi.generator' version '6.6.0'
}
openApiGenerate {
generatorName = "spring"
inputSpec = "$rootDir/openapi/specs/${project.name}.yaml"
outputDir = "$buildDir/generated-sources/openapi"
apiPackage = "com.datamate.${project.name}.interfaces.api"
modelPackage = "com.datamate.${project.name}.interfaces.dto"
configOptions = [
interfaceOnly: "true",
useTags: "true",
skipDefaultInterface: "true",
hideGenerationTimestamp: "true",
java8: "true",
dateLibrary: "java8",
useBeanValidation: "true",
performBeanValidation: "true",
useSpringBoot3: "true",
documentationProvider: "springdoc"
]
}
```
## Frontend TypeScript Client Generation
# 为前端生成TypeScript客户端:
```bash
# 安装 OpenAPI Generator CLI
npm install -g @openapitools/openapi-generator-cli
# 生成TypeScript客户端
openapi-generator-cli generate \
-i openapi/specs/data-annotation-service.yaml \
-g typescript-axios \
-o frontend/packages/api-client/src/generated/annotation \
--additional-properties=supportsES6=true,npmName=@datamate/annotation-api,npmVersion=1.0.0
```
## Usage in Services
# 在各个服务中使用生成的代码:
1. **在 interfaces 层实现生成的API接口**
```java
@RestController
@RequestMapping("/api/v1/annotation")
public class AnnotationTaskController implements AnnotationTasksApi {
private final AnnotationTaskApplicationService annotationTaskService;
@Override
public ResponseEntity<AnnotationTaskPageResponse> getAnnotationTasks(
Integer page, Integer size, String status) {
// 实现业务逻辑
return ResponseEntity.ok(annotationTaskService.getTasks(page, size, status));
}
}
```
2. **在 application 层使用生成的DTO**
```java
@Service
public class AnnotationTaskApplicationService {
public AnnotationTaskPageResponse getTasks(Integer page, Integer size, String status) {
// 业务逻辑实现
// 使用生成的DTO类型
}
}
```
## Build Integration
# 构建集成脚本位置:scripts/build/generate-api.sh
```bash
#!/bin/bash
# 生成所有服务的API代码
OPENAPI_DIR="openapi/specs"
SERVICES=(
"data-annotation-service"
"data-management-service"
"operator-market-service"
"data-cleaning-service"
"data-synthesis-service"
"data-evaluation-service"
"pipeline-orchestration-service"
"execution-engine-service"
"rag-indexer-service"
"rag-query-service"
"api-gateway"
"auth-service"
)
for service in "${SERVICES[@]}"; do
echo "Generating API for $service..."
mvn -f backend/services/$service/pom.xml openapi-generator:generate
done
echo "All APIs generated successfully!"
```

View File

@@ -0,0 +1,298 @@
openapi: 3.0.3
info:
title: Data Annotation Service API
description: 数据标注服务API - 智能预标注、人工平台、主动学习
version: 1.0.0
contact:
name: Data Mate Platform Team
servers:
- url: http://localhost:8080
description: Development server
tags:
- name: annotation-tasks
description: 标注任务管理
- name: annotation-data
description: 标注数据管理
- name: pre-annotation
description: 智能预标注
- name: active-learning
description: 主动学习
paths:
/api/v1/annotation/tasks:
get:
tags:
- annotation-tasks
summary: 获取标注任务列表
description: 分页获取标注任务列表
parameters:
- name: page
in: query
description: 页码
schema:
type: integer
default: 0
- name: size
in: query
description: 每页大小
schema:
type: integer
default: 20
- name: status
in: query
description: 任务状态
schema:
type: string
enum: [PENDING, IN_PROGRESS, COMPLETED, PAUSED]
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationTaskPageResponse'
'400':
description: 请求参数错误
'500':
description: 服务器内部错误
post:
tags:
- annotation-tasks
summary: 创建标注任务
description: 创建新的标注任务
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateAnnotationTaskRequest'
responses:
'201':
description: 创建成功
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationTaskResponse'
'400':
description: 请求参数错误
'500':
description: 服务器内部错误
/api/v1/annotation/tasks/{taskId}:
get:
tags:
- annotation-tasks
summary: 获取标注任务详情
parameters:
- name: taskId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationTaskResponse'
'404':
description: 任务不存在
put:
tags:
- annotation-tasks
summary: 更新标注任务
parameters:
- name: taskId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateAnnotationTaskRequest'
responses:
'200':
description: 更新成功
content:
application/json:
schema:
$ref: '#/components/schemas/AnnotationTaskResponse'
/api/v1/annotation/pre-annotate:
post:
tags:
- pre-annotation
summary: 智能预标注
description: 使用AI模型进行智能预标注
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PreAnnotationRequest'
responses:
'200':
description: 预标注成功
content:
application/json:
schema:
$ref: '#/components/schemas/PreAnnotationResponse'
components:
schemas:
AnnotationTaskResponse:
type: object
properties:
id:
type: string
description: 任务ID
name:
type: string
description: 任务名称
description:
type: string
description: 任务描述
type:
type: string
enum: [TEXT_CLASSIFICATION, NAMED_ENTITY_RECOGNITION, OBJECT_DETECTION, SEMANTIC_SEGMENTATION]
description: 标注类型
status:
type: string
enum: [PENDING, IN_PROGRESS, COMPLETED, PAUSED]
description: 任务状态
datasetId:
type: string
description: 数据集ID
progress:
type: number
format: double
description: 进度百分比
createdAt:
type: string
format: date-time
description: 创建时间
updatedAt:
type: string
format: date-time
description: 更新时间
CreateAnnotationTaskRequest:
type: object
required:
- name
- type
- datasetId
properties:
name:
type: string
description: 任务名称
description:
type: string
description: 任务描述
type:
type: string
enum: [TEXT_CLASSIFICATION, NAMED_ENTITY_RECOGNITION, OBJECT_DETECTION, SEMANTIC_SEGMENTATION]
description: 标注类型
datasetId:
type: string
description: 数据集ID
configuration:
type: object
description: 标注配置
UpdateAnnotationTaskRequest:
type: object
properties:
name:
type: string
description: 任务名称
description:
type: string
description: 任务描述
status:
type: string
enum: [PENDING, IN_PROGRESS, COMPLETED, PAUSED]
description: 任务状态
AnnotationTaskPageResponse:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/AnnotationTaskResponse'
totalElements:
type: integer
format: int64
totalPages:
type: integer
size:
type: integer
number:
type: integer
PreAnnotationRequest:
type: object
required:
- taskId
- dataIds
properties:
taskId:
type: string
description: 标注任务ID
dataIds:
type: array
items:
type: string
description: 待预标注的数据ID列表
modelId:
type: string
description: 预标注模型ID
confidence:
type: number
format: double
description: 置信度阈值
PreAnnotationResponse:
type: object
properties:
taskId:
type: string
description: 任务ID
processedCount:
type: integer
description: 已处理数据数量
successCount:
type: integer
description: 成功预标注数量
results:
type: array
items:
type: object
properties:
dataId:
type: string
annotations:
type: array
items:
type: object
confidence:
type: number
format: double
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- BearerAuth: []

View File

@@ -0,0 +1,491 @@
openapi: 3.0.3
info:
title: Data Cleaning Service API
description: 数据清洗服务API - 策略/规则、流程编排对接
version: 1.0.0
contact:
name: Data Mate Platform Team
servers:
- url: http://localhost:8084
description: Development server
tags:
- name: CleaningTask
description: 数据清洗任务管理
- name: CleaningTemplate
description: 数据清洗模板管理
paths:
/ray/log:
get:
summary: 获取ray日志文件
deprecated: false
description: ''
tags: [ ]
parameters: [ ]
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties: { }
headers: { }
security: [ ]
/cleaning/tasks:
get:
summary: 查询数据清洗任务列表
deprecated: false
description: 获取所有数据清洗任务或根据查询参数筛选任务。
tags:
- CleaningTask
parameters:
- name: status
in: query
description: 根据任务状态筛选 (e.g., pending, running, completed, failed)
required: false
schema:
type: string
- name: keywords
in: query
description: 关键字
required: false
schema:
type: string
- name: page
in: query
description: 分页数
required: true
schema:
type: integer
- name: size
in: query
description: 分页单页数
required: true
schema:
type: integer
responses:
'200':
description: 成功获取任务列表
content:
application/json:
schema:
type: array
items: &ref_1
$ref: '#/components/schemas/CleaningTask'
headers: { }
security: [ ]
post:
summary: 创建新的数据清洗任务
deprecated: false
description: 可以直接创建任务或基于现有模板创建任务。
tags:
- CleaningTask
parameters: [ ]
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCleaningTaskRequest'
examples: { }
responses:
'201':
description: 任务创建成功
content:
application/json:
schema: *ref_1
headers: { }
security: [ ]
/cleaning/tasks/{taskId}:
get:
summary: 获取单个数据清洗任务详情
deprecated: false
description: 根据任务ID获取任务的详细信息。
tags:
- CleaningTask
parameters:
- name: taskId
in: path
description: 任务的唯一标识符
required: true
example: ''
schema:
type: string
responses:
'200':
description: 成功获取任务详情
content:
application/json:
schema: *ref_1
headers: { }
security: [ ]
delete:
summary: 删除数据清洗任务
deprecated: false
description: 根据任务ID删除指定的任务。
tags:
- CleaningTask
parameters:
- name: taskId
in: path
description: 任务的唯一标识符
required: true
example: ''
schema:
type: string
responses:
'204':
description: 任务删除成功
headers: { }
security: [ ]
/cleaning/templates:
get:
summary: 查询数据清洗模板列表
deprecated: false
description: 获取所有可用的数据清洗模板。
tags:
- CleaningTemplate
parameters: [ ]
responses:
'200':
description: 成功获取模板列表
content:
application/json:
schema:
type: array
items: &ref_2
$ref: '#/components/schemas/CleaningTemplate'
headers: { }
security: [ ]
post:
summary: 创建新的数据清洗模板
deprecated: false
description: 定义一个新的数据清洗模板。
tags:
- CleaningTemplate
parameters: [ ]
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCleaningTemplateRequest'
responses:
'201':
description: 模板创建成功
content:
application/json:
schema: *ref_2
headers: { }
security: [ ]
/cleaning/templates/{templateId}:
get:
summary: 获取单个数据清洗模板详情
deprecated: false
description: 根据模板ID获取模板的详细信息。
tags:
- CleaningTemplate
parameters:
- name: templateId
in: path
description: 模板的唯一标识符
required: true
example: ''
schema:
type: string
responses:
'200':
description: 成功获取模板详情
content:
application/json:
schema: *ref_2
headers: { }
security: [ ]
put:
summary: 更新数据清洗模板
deprecated: false
description: 根据模板ID更新模板的全部信息。
tags:
- CleaningTemplate
parameters:
- name: templateId
in: path
description: 模板的唯一标识符
required: true
example: ''
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCleaningTemplateRequest'
responses:
'200':
description: 模板更新成功
content:
application/json:
schema: *ref_2
headers: { }
security: [ ]
delete:
summary: 删除数据清洗模板
deprecated: false
description: 根据模板ID删除指定的模板。
tags:
- CleaningTemplate
parameters:
- name: templateId
in: path
description: 模板的唯一标识符
required: true
example: ''
schema:
type: string
responses:
'204':
description: 模板删除成功
headers: { }
security: [ ]
components:
schemas:
OperatorInstance:
type: object
properties:
id:
type: string
overrides:
type: object
properties: { }
additionalProperties:
type: object
properties: { }
required:
- id
- overrides
CleaningProcess:
type: object
properties:
process:
type: number
format: float
description: 进度百分比
totalFileNum:
type: integer
description: 总文件数量
finishedFileNum:
type: integer
description: 已完成文件数量
required:
- process
- totalFileNum
- finishedFileNum
OperatorResponse:
type: object
properties:
id:
type: string
description: 算子ID
name:
type: string
description: 算子名称
description:
type: string
description: 算子描述
version:
type: string
description: 算子版本
inputs:
type: string
description: 输入类型
outputs:
type: string
description: 输入类型
runtime:
type: string
description: 运行时设置
settings:
type: string
description: 算子参数
isStar:
type: boolean
description: 是否收藏
createdAt:
type: string
format: date-time
description: 创建时间
updatedAt:
type: string
format: date-time
description: 更新时间
required:
- inputs
- outputs
- runtime
- settings
- isStar
UpdateCleaningTemplateRequest:
type: object
required:
- name
- instance
- id
properties:
id:
type: string
name:
type: string
description: 模板名称
description:
type: string
description: 模板描述
instance:
type: array
items: &ref_3
$ref: '#/components/schemas/OperatorInstance'
description: 模板定义的清洗规则和配置
CreateCleaningTemplateRequest:
type: object
required:
- name
- instance
properties:
name:
type: string
description: 模板名称
description:
type: string
description: 模板描述
instance:
type: array
items: *ref_3
description: 任务的具体配置(如果非模板创建,则直接定义)'
CleaningTemplate:
type: object
required:
- id
- name
- instance
- createdAt
properties:
id:
type: string
description: 模板唯一标识符
name:
type: string
description: 模板名称
description:
type: string
description: 模板描述
instance:
type: array
items: &ref_4
$ref: '#/components/schemas/OperatorResponse'
description: 模板定义的清洗规则和配置
createdAt:
type: string
format: date-time
description: 模板创建时间
updatedAt:
type: string
format: date-time
description: 模板最后更新时间
CreateCleaningTaskRequest:
type: object
required:
- name
- instance
- srcDatasetId
- srcDatasetName
- destDatasetName
- destDatasetType
properties:
name:
type: string
description: 任务名称
description:
type: string
description: 任务描述
srcDatasetId:
type: string
srcDatasetName:
type: string
destDatasetName:
type: string
destDatasetType:
type: string
instance:
type: array
items: *ref_3
description: 任务的具体配置(如果非模板创建,则直接定义)
ErrorResponse:
type: object
properties:
error:
type: string
description: 错误类型
message:
type: string
description: 错误详细信息
CleaningTask:
type: object
required:
- id
- name
- status
- createdAt
- startedAt
properties:
id:
type: string
description: 任务唯一标识符
name:
type: string
description: 任务名称
description:
type: string
description: 任务描述
srcDatasetId:
type: string
description: 源数据集id
srcDatasetName:
type: string
description: 源数据集名称
destDatasetId:
type: string
description: 目标数据集id
destDatasetName:
type: string
description: 目标数据集名称
status:
type: string
description: 任务当前状态
enum:
- pending
- running
- completed
- failed
templateId:
type: string
description: 关联的模板ID(如果基于模板创建)
instance:
type: array
items: *ref_4
description: 任务的具体配置(如果非模板创建,则直接定义)
progress:
$ref: '#/components/schemas/CleaningProcess'
createdAt:
type: string
description: 任务创建时间
format: date-time
startedAt:
type: string
format: date-time
description: 任务开始时间
finishedAt:
type: string
format: date-time
description: 任务最后更新时间
securitySchemes: { }

View File

@@ -0,0 +1,517 @@
openapi: 3.0.3
info:
title: Data Collection Service API
description: |
数据归集服务API,基于数据归集实现数据采集和归集功能。
主要功能:
- 数据归集任务创建和管理
- 数据同步任务执行
- 任务监控和状态查询
- 执行日志查看
version: 1.0.0
servers:
- url: http://localhost:8090/api/v1/collection
description: Development server
tags:
- name: CollectionTask
description: 数据归集任务管理(包括模板查询)
- name: TaskExecution
description: 任务执行管理
paths:
/data-collection/tasks:
get:
operationId: getTasks
tags: [CollectionTask]
summary: 获取归集任务列表
parameters:
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
- name: status
in: query
schema:
$ref: '#/components/schemas/TaskStatus'
- name: name
in: query
description: 任务名称关键字搜索
schema:
type: string
responses:
'200':
description: 归集任务列表
content:
application/json:
schema:
$ref: '#/components/schemas/PagedCollectionTaskSummary'
post:
operationId: createTask
tags: [CollectionTask]
summary: 创建归集任务
description: 创建新的数据归集任务
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCollectionTaskRequest'
responses:
'201':
description: 归集任务创建成功
content:
application/json:
schema:
$ref: '#/components/schemas/CollectionTaskResponse'
/data-collection/tasks/{id}:
get:
operationId: getTaskDetail
tags: [CollectionTask]
summary: 获取归集任务详情
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: 归集任务详情
content:
application/json:
schema:
$ref: '#/components/schemas/CollectionTaskResponse'
'404':
description: 归集任务不存在
put:
operationId: updateTask
tags: [CollectionTask]
summary: 更新归集任务
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCollectionTaskRequest'
responses:
'200':
description: 归集任务更新成功
content:
application/json:
schema:
$ref: '#/components/schemas/CollectionTaskResponse'
delete:
operationId: deleteTask
tags: [CollectionTask]
summary: 删除归集任务
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'204':
description: 归集任务删除成功
/tasks/{id}/execute:
post:
tags: [TaskExecution]
summary: 执行归集任务
description: 立即执行指定的归集任务
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'201':
description: 任务执行已启动
content:
application/json:
schema:
$ref: '#/components/schemas/TaskExecutionResponse'
/tasks/{id}/executions:
get:
tags: [TaskExecution]
summary: 获取任务执行记录
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
responses:
'200':
description: 任务执行记录列表
content:
application/json:
schema:
$ref: '#/components/schemas/PagedTaskExecutions'
/executions/{id}:
get:
tags: [TaskExecution]
summary: 获取执行详情
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: 执行详情
content:
application/json:
schema:
$ref: '#/components/schemas/TaskExecutionDetail'
delete:
tags: [TaskExecution]
summary: 停止任务执行
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'204':
description: 任务执行已停止
/templates:
get:
tags: [CollectionTask]
summary: 获取DataX模板列表
description: 获取可用的DataX任务模板列表,用于创建任务时选择
parameters:
- name: sourceType
in: query
description: 源数据源类型过滤
schema:
type: string
- name: targetType
in: query
description: 目标数据源类型过滤
schema:
type: string
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
responses:
'200':
description: 归集模板列表
content:
application/json:
schema:
$ref: '#/components/schemas/PagedDataxTemplates'
components:
schemas:
TaskStatus:
type: string
enum:
- DRAFT
- READY
- RUNNING
- SUCCESS
- FAILED
- STOPPED
description: |
任务和执行状态枚举:
- DRAFT: 草稿状态
- READY: 就绪状态
- RUNNING: 运行中
- SUCCESS: 执行成功 (对应原来的COMPLETED/SUCCESS)
- FAILED: 执行失败
- STOPPED: 已停止
SyncMode:
type: string
enum: [ONCE, SCHEDULED]
description: 同步方式:一次性(ONCE) 或 定时(SCHEDULED)
CollectionTaskSummary:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
status:
$ref: '#/components/schemas/TaskStatus'
syncMode:
$ref: '#/components/schemas/SyncMode'
lastExecutionId:
type: string
description: 最后执行ID
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
description: 任务列表摘要信息(不包含详细配置与调度表达式)
CollectionTaskResponse:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
config:
type: object
additionalProperties: true
description: 归集配置,包含源端和目标端配置信息
status:
$ref: '#/components/schemas/TaskStatus'
syncMode:
$ref: '#/components/schemas/SyncMode'
scheduleExpression:
type: string
description: Cron调度表达式 (仅当 syncMode = SCHEDULED 时有效)
lastExecutionId:
type: string
description: 最后执行ID
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
CreateCollectionTaskRequest:
type: object
required:
- name
- config
- syncMode
properties:
name:
type: string
description: 任务名称
minLength: 1
maxLength: 100
description:
type: string
description: 任务描述
maxLength: 500
config:
type: object
description: 归集配置,包含源端和目标端配置信息
additionalProperties: true
syncMode:
$ref: '#/components/schemas/SyncMode'
scheduleExpression:
type: string
description: Cron调度表达式 (syncMode=SCHEDULED 时必填)
UpdateCollectionTaskRequest:
type: object
properties:
name:
type: string
description: 任务名称
minLength: 1
maxLength: 100
description:
type: string
description: 任务描述
maxLength: 500
config:
type: object
description: 归集配置,包含源端和目标端配置信息
additionalProperties: true
syncMode:
$ref: '#/components/schemas/SyncMode'
scheduleExpression:
type: string
description: Cron调度表达式 (syncMode=SCHEDULED 时必填)
PagedCollectionTaskSummary:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/CollectionTaskSummary'
totalElements:
type: integer
totalPages:
type: integer
number:
type: integer
size:
type: integer
PagedCollectionTasks:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/CollectionTaskResponse'
totalElements:
type: integer
totalPages:
type: integer
number:
type: integer
size:
type: integer
TaskExecutionResponse:
type: object
properties:
id:
type: string
taskId:
type: string
taskName:
type: string
status:
$ref: '#/components/schemas/TaskStatus'
startedAt:
type: string
format: date-time
TaskExecutionDetail:
type: object
properties:
id:
type: string
taskId:
type: string
taskName:
type: string
status:
$ref: '#/components/schemas/TaskStatus'
progress:
type: number
format: double
minimum: 0
maximum: 100
recordsTotal:
type: integer
recordsProcessed:
type: integer
recordsSuccess:
type: integer
recordsFailed:
type: integer
throughput:
type: number
format: double
dataSizeBytes:
type: integer
startedAt:
type: string
format: date-time
completedAt:
type: string
format: date-time
durationSeconds:
type: integer
errorMessage:
type: string
PagedTaskExecutions:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/TaskExecutionDetail'
totalElements:
type: integer
totalPages:
type: integer
number:
type: integer
size:
type: integer
DataxTemplateSummary:
type: object
properties:
id:
type: string
name:
type: string
sourceType:
type: string
description: 源数据源类型
targetType:
type: string
description: 目标数据源类型
description:
type: string
version:
type: string
isSystem:
type: boolean
description: 是否为系统模板
createdAt:
type: string
format: date-time
PagedDataxTemplates:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/DataxTemplateSummary'
totalElements:
type: integer
totalPages:
type: integer
number:
type: integer
size:
type: integer

View File

@@ -0,0 +1,630 @@
openapi: 3.0.3
info:
title: Data Evaluation Service API
description: 数据评估服务API - 质量、适配性、价值评估
version: 1.0.0
contact:
name: Data Mate Platform Team
servers:
- url: http://localhost:8086
description: Development server
tags:
- name: quality-evaluation
description: 数据质量评估
- name: compatibility-evaluation
description: 适配性评估
- name: value-evaluation
description: 价值评估
- name: evaluation-reports
description: 评估报告
paths:
/api/v1/evaluation/quality:
post:
tags:
- quality-evaluation
summary: 数据质量评估
description: 对数据集进行质量评估,包括完整性、准确性、一致性等
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/QualityEvaluationRequest'
responses:
'200':
description: 评估成功
content:
application/json:
schema:
$ref: '#/components/schemas/QualityEvaluationResponse'
/api/v1/evaluation/quality/{evaluationId}:
get:
tags:
- quality-evaluation
summary: 获取质量评估结果
parameters:
- name: evaluationId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/QualityEvaluationDetailResponse'
/api/v1/evaluation/compatibility:
post:
tags:
- compatibility-evaluation
summary: 适配性评估
description: 评估数据集与目标模型或任务的适配性
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CompatibilityEvaluationRequest'
responses:
'200':
description: 评估成功
content:
application/json:
schema:
$ref: '#/components/schemas/CompatibilityEvaluationResponse'
/api/v1/evaluation/value:
post:
tags:
- value-evaluation
summary: 价值评估
description: 评估数据集的商业价值和使用价值
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ValueEvaluationRequest'
responses:
'200':
description: 评估成功
content:
application/json:
schema:
$ref: '#/components/schemas/ValueEvaluationResponse'
/api/v1/evaluation/reports:
get:
tags:
- evaluation-reports
summary: 获取评估报告列表
parameters:
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
- name: type
in: query
schema:
$ref: '#/components/schemas/EvaluationType'
- name: datasetId
in: query
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluationReportPageResponse'
/api/v1/evaluation/reports/{reportId}:
get:
tags:
- evaluation-reports
summary: 获取评估报告详情
parameters:
- name: reportId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/EvaluationReportDetailResponse'
/api/v1/evaluation/reports/{reportId}/export:
get:
tags:
- evaluation-reports
summary: 导出评估报告
parameters:
- name: reportId
in: path
required: true
schema:
type: string
- name: format
in: query
schema:
type: string
enum: [PDF, EXCEL, JSON]
default: PDF
responses:
'200':
description: 导出成功
content:
application/octet-stream:
schema:
type: string
format: binary
/api/v1/evaluation/batch:
post:
tags:
- evaluation-reports
summary: 批量评估
description: 对多个数据集进行批量评估
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchEvaluationRequest'
responses:
'202':
description: 批量评估任务已提交
content:
application/json:
schema:
$ref: '#/components/schemas/BatchEvaluationResponse'
components:
schemas:
QualityEvaluationRequest:
type: object
required:
- datasetId
- metrics
properties:
datasetId:
type: string
description: 数据集ID
metrics:
type: array
items:
$ref: '#/components/schemas/QualityMetric'
description: 评估指标
sampleSize:
type: integer
description: 采样大小
parameters:
type: object
description: 评估参数
QualityEvaluationResponse:
type: object
properties:
evaluationId:
type: string
status:
$ref: '#/components/schemas/EvaluationStatus'
overallScore:
type: number
format: double
description: 总体质量分数
metrics:
type: array
items:
$ref: '#/components/schemas/QualityMetricResult'
recommendations:
type: array
items:
type: string
createdAt:
type: string
format: date-time
QualityEvaluationDetailResponse:
allOf:
- $ref: '#/components/schemas/QualityEvaluationResponse'
- type: object
properties:
detailedResults:
$ref: '#/components/schemas/DetailedQualityResults'
visualizations:
type: array
items:
$ref: '#/components/schemas/VisualizationData'
CompatibilityEvaluationRequest:
type: object
required:
- datasetId
- targetType
properties:
datasetId:
type: string
targetType:
$ref: '#/components/schemas/TargetType'
targetConfig:
type: object
description: 目标配置(模型、任务等)
evaluationCriteria:
type: array
items:
$ref: '#/components/schemas/CompatibilityCriterion'
CompatibilityEvaluationResponse:
type: object
properties:
evaluationId:
type: string
compatibilityScore:
type: number
format: double
results:
type: array
items:
$ref: '#/components/schemas/CompatibilityResult'
suggestions:
type: array
items:
type: string
createdAt:
type: string
format: date-time
ValueEvaluationRequest:
type: object
required:
- datasetId
- valueCriteria
properties:
datasetId:
type: string
valueCriteria:
type: array
items:
$ref: '#/components/schemas/ValueCriterion'
marketContext:
type: object
description: 市场环境信息
businessContext:
type: object
description: 业务环境信息
ValueEvaluationResponse:
type: object
properties:
evaluationId:
type: string
valueScore:
type: number
format: double
monetaryValue:
type: number
format: double
description: 货币价值估算
strategicValue:
type: number
format: double
description: 战略价值评分
results:
type: array
items:
$ref: '#/components/schemas/ValueResult'
insights:
type: array
items:
type: string
EvaluationReportResponse:
type: object
properties:
id:
type: string
datasetId:
type: string
type:
$ref: '#/components/schemas/EvaluationType'
status:
$ref: '#/components/schemas/EvaluationStatus'
overallScore:
type: number
format: double
summary:
type: string
createdAt:
type: string
format: date-time
completedAt:
type: string
format: date-time
EvaluationReportPageResponse:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/EvaluationReportResponse'
totalElements:
type: integer
format: int64
totalPages:
type: integer
size:
type: integer
number:
type: integer
EvaluationReportDetailResponse:
allOf:
- $ref: '#/components/schemas/EvaluationReportResponse'
- type: object
properties:
qualityResults:
$ref: '#/components/schemas/QualityEvaluationResponse'
compatibilityResults:
$ref: '#/components/schemas/CompatibilityEvaluationResponse'
valueResults:
$ref: '#/components/schemas/ValueEvaluationResponse'
attachments:
type: array
items:
$ref: '#/components/schemas/ReportAttachment'
BatchEvaluationRequest:
type: object
required:
- datasetIds
- evaluationTypes
properties:
datasetIds:
type: array
items:
type: string
evaluationTypes:
type: array
items:
$ref: '#/components/schemas/EvaluationType'
parameters:
type: object
BatchEvaluationResponse:
type: object
properties:
batchId:
type: string
status:
type: string
totalTasks:
type: integer
submittedAt:
type: string
format: date-time
QualityMetric:
type: string
enum:
- COMPLETENESS
- ACCURACY
- CONSISTENCY
- VALIDITY
- UNIQUENESS
- TIMELINESS
QualityMetricResult:
type: object
properties:
metric:
$ref: '#/components/schemas/QualityMetric'
score:
type: number
format: double
details:
type: object
issues:
type: array
items:
$ref: '#/components/schemas/QualityIssue'
DetailedQualityResults:
type: object
properties:
fieldAnalysis:
type: array
items:
$ref: '#/components/schemas/FieldAnalysis'
distributionAnalysis:
$ref: '#/components/schemas/DistributionAnalysis'
correlationAnalysis:
$ref: '#/components/schemas/CorrelationAnalysis'
TargetType:
type: string
enum:
- LANGUAGE_MODEL
- CLASSIFICATION_MODEL
- RECOMMENDATION_SYSTEM
- CUSTOM_TASK
CompatibilityCriterion:
type: string
enum:
- FORMAT_COMPATIBILITY
- SCHEMA_COMPATIBILITY
- SIZE_ADEQUACY
- DISTRIBUTION_MATCH
- FEATURE_COVERAGE
CompatibilityResult:
type: object
properties:
criterion:
$ref: '#/components/schemas/CompatibilityCriterion'
score:
type: number
format: double
status:
type: string
enum: [PASS, WARN, FAIL]
details:
type: string
ValueCriterion:
type: string
enum:
- RARITY
- DEMAND
- QUALITY
- COMPLETENESS
- TIMELINESS
- STRATEGIC_IMPORTANCE
ValueResult:
type: object
properties:
criterion:
$ref: '#/components/schemas/ValueCriterion'
score:
type: number
format: double
impact:
type: string
enum: [LOW, MEDIUM, HIGH]
explanation:
type: string
EvaluationType:
type: string
enum:
- QUALITY
- COMPATIBILITY
- VALUE
- COMPREHENSIVE
EvaluationStatus:
type: string
enum:
- PENDING
- RUNNING
- COMPLETED
- FAILED
QualityIssue:
type: object
properties:
type:
type: string
severity:
type: string
enum: [LOW, MEDIUM, HIGH, CRITICAL]
description:
type: string
affectedRecords:
type: integer
suggestions:
type: array
items:
type: string
FieldAnalysis:
type: object
properties:
fieldName:
type: string
dataType:
type: string
nullCount:
type: integer
uniqueCount:
type: integer
statistics:
type: object
DistributionAnalysis:
type: object
properties:
distributions:
type: array
items:
type: object
outliers:
type: array
items:
type: object
patterns:
type: array
items:
type: string
CorrelationAnalysis:
type: object
properties:
correlationMatrix:
type: array
items:
type: array
items:
type: number
significantCorrelations:
type: array
items:
type: object
VisualizationData:
type: object
properties:
type:
type: string
enum: [CHART, GRAPH, HISTOGRAM, HEATMAP]
title:
type: string
data:
type: object
config:
type: object
ReportAttachment:
type: object
properties:
id:
type: string
name:
type: string
type:
type: string
size:
type: integer
format: int64
downloadUrl:
type: string
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- BearerAuth: []

View File

@@ -0,0 +1,719 @@
openapi: 3.0.3
info:
title: Data Management Service API
description: |
数据管理服务API,提供数据集的创建、管理和文件操作功能。
主要功能:
- 数据集的创建和管理
- 多种数据集类型支持(图像、文本、音频、视频、多模态等)
- 数据集文件管理
- 数据集标签和元数据管理
- 数据集统计信息
version: 1.0.0
servers:
- url: http://localhost:8092/api/v1/data-management
description: Development server
tags:
- name: Dataset
description: 数据集管理
- name: DatasetFile
description: 数据集文件管理
- name: DatasetType
description: 数据集类型管理
- name: Tag
description: 标签管理
paths:
/data-management/datasets:
get:
tags: [Dataset]
operationId: getDatasets
summary: 获取数据集列表
description: 分页查询数据集列表,支持按类型、标签等条件筛选
parameters:
- name: page
in: query
schema:
type: integer
default: 0
description: 页码,从0开始
- 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: [ACTIVE, INACTIVE, PROCESSING]
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:
'201':
description: 创建成功
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetResponse'
'400':
description: 请求参数错误
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/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'
/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: page
in: query
schema:
type: integer
default: 0
description: 页码,从0开始
- name: size
in: query
schema:
type: integer
default: 20
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/PagedDatasetFileResponse'
post:
tags: [DatasetFile]
summary: 上传文件到数据集
operationId: uploadDatasetFile
description: 向指定数据集上传文件
parameters:
- name: datasetId
in: path
required: true
schema:
type: string
description: 数据集ID
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
description: 要上传的文件
description:
type: string
description: 文件描述
responses:
'201':
description: 上传成功
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetFileResponse'
/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
responses:
'200':
description: 成功
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetFileResponse'
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
responses:
'204':
description: 删除成功
/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
/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'
/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:
type: array
items:
$ref: '#/components/schemas/TagResponse'
post:
tags: [Tag]
operationId: createTag
summary: 创建标签
description: 创建新的标签
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTagRequest'
responses:
'201':
description: 创建成功
content:
application/json:
schema:
$ref: '#/components/schemas/TagResponse'
/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/DatasetStatisticsResponse'
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: 是否为最后一页
DatasetResponse:
type: object
properties:
id:
type: string
description: 数据集ID
name:
type: string
description: 数据集名称
description:
type: string
description: 数据集描述
type:
$ref: '#/components/schemas/DatasetTypeResponse'
status:
type: string
enum: [ACTIVE, INACTIVE, PROCESSING]
description: 数据集状态
tags:
type: array
items:
$ref: '#/components/schemas/TagResponse'
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: 创建者
CreateDatasetRequest:
type: object
required:
- name
- type
properties:
name:
type: string
description: 数据集名称
minLength: 1
maxLength: 100
description:
type: string
description: 数据集描述
maxLength: 500
type:
type: string
description: 数据集类型
tags:
type: array
items:
type: string
description: 标签列表
dataSource:
type: string
description: 数据源
targetLocation:
type: string
description: 目标位置
UpdateDatasetRequest:
type: object
properties:
name:
type: string
description: 数据集名称
maxLength: 100
description:
type: string
description: 数据集描述
maxLength: 500
tags:
type: array
items:
type: string
description: 标签列表
status:
type: string
enum: [ACTIVE, INACTIVE]
description: 数据集状态
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: 是否为最后一页
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: 文件路径
uploadTime:
type: string
format: date-time
description: 上传时间
uploadedBy:
type: string
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: 使用次数
CreateTagRequest:
type: object
required:
- name
properties:
name:
type: string
description: 标签名称
minLength: 1
maxLength: 50
color:
type: string
description: 标签颜色
pattern: '^#[0-9A-Fa-f]{6}$'
description:
type: string
description: 标签描述
maxLength: 200
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: 请求路径

View File

@@ -0,0 +1,620 @@
openapi: 3.0.3
info:
title: Data Synthesis Service API
description: 数据合成服务API - 指令、COT蒸馏、多模态合成
version: 1.0.0
contact:
name: Data Mate Platform Team
servers:
- url: http://localhost:8085
description: Development server
tags:
- name: synthesis-templates
description: 合成模板管理
- name: synthesis-jobs
description: 合成任务管理
- name: instruction-tuning
description: 指令调优
- name: cot-distillation
description: COT蒸馏
paths:
/api/v1/synthesis/templates:
get:
tags:
- synthesis-templates
summary: 获取合成模板列表
parameters:
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
- name: type
in: query
schema:
$ref: '#/components/schemas/SynthesisType'
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/SynthesisTemplatePageResponse'
post:
tags:
- synthesis-templates
summary: 创建合成模板
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSynthesisTemplateRequest'
responses:
'201':
description: 创建成功
content:
application/json:
schema:
$ref: '#/components/schemas/SynthesisTemplateResponse'
/api/v1/synthesis/templates/{templateId}:
get:
tags:
- synthesis-templates
summary: 获取合成模板详情
parameters:
- name: templateId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/SynthesisTemplateDetailResponse'
put:
tags:
- synthesis-templates
summary: 更新合成模板
parameters:
- name: templateId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateSynthesisTemplateRequest'
responses:
'200':
description: 更新成功
/api/v1/synthesis/jobs:
get:
tags:
- synthesis-jobs
summary: 获取合成任务列表
parameters:
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
- name: status
in: query
schema:
$ref: '#/components/schemas/JobStatus'
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/SynthesisJobPageResponse'
post:
tags:
- synthesis-jobs
summary: 创建合成任务
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSynthesisJobRequest'
responses:
'201':
description: 任务创建成功
content:
application/json:
schema:
$ref: '#/components/schemas/SynthesisJobResponse'
/api/v1/synthesis/jobs/{jobId}:
get:
tags:
- synthesis-jobs
summary: 获取合成任务详情
parameters:
- name: jobId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/SynthesisJobDetailResponse'
/api/v1/synthesis/jobs/{jobId}/execute:
post:
tags:
- synthesis-jobs
summary: 执行合成任务
parameters:
- name: jobId
in: path
required: true
schema:
type: string
responses:
'200':
description: 任务开始执行
content:
application/json:
schema:
$ref: '#/components/schemas/JobExecutionResponse'
/api/v1/synthesis/instruction-tuning:
post:
tags:
- instruction-tuning
summary: 指令调优数据合成
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/InstructionTuningRequest'
responses:
'200':
description: 合成成功
content:
application/json:
schema:
$ref: '#/components/schemas/InstructionTuningResponse'
/api/v1/synthesis/cot-distillation:
post:
tags:
- cot-distillation
summary: COT蒸馏数据合成
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/COTDistillationRequest'
responses:
'200':
description: 蒸馏成功
content:
application/json:
schema:
$ref: '#/components/schemas/COTDistillationResponse'
components:
schemas:
SynthesisTemplateResponse:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
type:
$ref: '#/components/schemas/SynthesisType'
category:
type: string
modelConfig:
$ref: '#/components/schemas/ModelConfig'
enabled:
type: boolean
createdAt:
type: string
format: date-time
SynthesisTemplateDetailResponse:
allOf:
- $ref: '#/components/schemas/SynthesisTemplateResponse'
- type: object
properties:
promptTemplate:
type: string
parameters:
type: object
examples:
type: array
items:
$ref: '#/components/schemas/SynthesisExample'
SynthesisTemplatePageResponse:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/SynthesisTemplateResponse'
totalElements:
type: integer
format: int64
totalPages:
type: integer
size:
type: integer
number:
type: integer
CreateSynthesisTemplateRequest:
type: object
required:
- name
- type
- promptTemplate
properties:
name:
type: string
description:
type: string
type:
$ref: '#/components/schemas/SynthesisType'
category:
type: string
promptTemplate:
type: string
modelConfig:
$ref: '#/components/schemas/ModelConfig'
parameters:
type: object
UpdateSynthesisTemplateRequest:
type: object
properties:
name:
type: string
description:
type: string
promptTemplate:
type: string
enabled:
type: boolean
parameters:
type: object
SynthesisJobResponse:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
templateId:
type: string
status:
$ref: '#/components/schemas/JobStatus'
progress:
type: number
format: double
targetCount:
type: integer
generatedCount:
type: integer
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
createdAt:
type: string
format: date-time
SynthesisJobDetailResponse:
allOf:
- $ref: '#/components/schemas/SynthesisJobResponse'
- type: object
properties:
template:
$ref: '#/components/schemas/SynthesisTemplateResponse'
statistics:
$ref: '#/components/schemas/SynthesisStatistics'
samples:
type: array
items:
$ref: '#/components/schemas/GeneratedSample'
SynthesisJobPageResponse:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/SynthesisJobResponse'
totalElements:
type: integer
format: int64
totalPages:
type: integer
size:
type: integer
number:
type: integer
CreateSynthesisJobRequest:
type: object
required:
- name
- templateId
- targetCount
properties:
name:
type: string
description:
type: string
templateId:
type: string
targetCount:
type: integer
parameters:
type: object
seedData:
type: array
items:
type: object
JobExecutionResponse:
type: object
properties:
executionId:
type: string
status:
type: string
message:
type: string
InstructionTuningRequest:
type: object
required:
- baseInstructions
- targetDomain
- count
properties:
baseInstructions:
type: array
items:
type: string
targetDomain:
type: string
count:
type: integer
modelConfig:
$ref: '#/components/schemas/ModelConfig'
parameters:
type: object
InstructionTuningResponse:
type: object
properties:
jobId:
type: string
generatedInstructions:
type: array
items:
$ref: '#/components/schemas/GeneratedInstruction'
statistics:
$ref: '#/components/schemas/GenerationStatistics'
COTDistillationRequest:
type: object
required:
- sourceModel
- targetFormat
- examples
properties:
sourceModel:
type: string
targetFormat:
type: string
enum: [QA, INSTRUCTION, REASONING]
examples:
type: array
items:
$ref: '#/components/schemas/COTExample'
parameters:
type: object
COTDistillationResponse:
type: object
properties:
jobId:
type: string
distilledData:
type: array
items:
$ref: '#/components/schemas/DistilledCOTData'
statistics:
$ref: '#/components/schemas/DistillationStatistics'
SynthesisType:
type: string
enum:
- INSTRUCTION_TUNING
- COT_DISTILLATION
- DIALOGUE_GENERATION
- TEXT_AUGMENTATION
- MULTIMODAL_SYNTHESIS
- CUSTOM
JobStatus:
type: string
enum:
- PENDING
- RUNNING
- COMPLETED
- FAILED
- CANCELLED
ModelConfig:
type: object
properties:
modelName:
type: string
temperature:
type: number
format: double
maxTokens:
type: integer
topP:
type: number
format: double
frequencyPenalty:
type: number
format: double
SynthesisExample:
type: object
properties:
input:
type: string
output:
type: string
explanation:
type: string
SynthesisStatistics:
type: object
properties:
totalGenerated:
type: integer
successfulGenerated:
type: integer
failedGenerated:
type: integer
averageLength:
type: number
format: double
uniqueCount:
type: integer
GeneratedSample:
type: object
properties:
id:
type: string
content:
type: string
score:
type: number
format: double
metadata:
type: object
createdAt:
type: string
format: date-time
GeneratedInstruction:
type: object
properties:
instruction:
type: string
input:
type: string
output:
type: string
quality:
type: number
format: double
GenerationStatistics:
type: object
properties:
totalGenerated:
type: integer
averageQuality:
type: number
format: double
diversityScore:
type: number
format: double
COTExample:
type: object
properties:
question:
type: string
reasoning:
type: string
answer:
type: string
DistilledCOTData:
type: object
properties:
question:
type: string
reasoning:
type: string
answer:
type: string
confidence:
type: number
format: double
DistillationStatistics:
type: object
properties:
totalProcessed:
type: integer
successfulDistilled:
type: integer
averageConfidence:
type: number
format: double
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- BearerAuth: []

View File

@@ -0,0 +1,712 @@
openapi: 3.0.3
info:
title: Execution Engine Service API
description: 执行引擎服务API - 与Ray/DataX/Python执行器对接
version: 1.0.0
contact:
name: Data Mate Platform Team
servers:
- url: http://localhost:8088
description: Development server
tags:
- name: jobs
description: 作业管理
- name: executors
description: 执行器管理
- name: resources
description: 资源管理
- name: monitoring
description: 监控管理
paths:
/api/v1/jobs:
get:
tags:
- jobs
summary: 获取作业列表
parameters:
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
- name: status
in: query
schema:
$ref: '#/components/schemas/JobStatus'
- name: executor
in: query
schema:
$ref: '#/components/schemas/ExecutorType'
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/JobPageResponse'
post:
tags:
- jobs
summary: 提交作业
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubmitJobRequest'
responses:
'201':
description: 作业提交成功
content:
application/json:
schema:
$ref: '#/components/schemas/JobResponse'
/api/v1/jobs/{jobId}:
get:
tags:
- jobs
summary: 获取作业详情
parameters:
- name: jobId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/JobDetailResponse'
delete:
tags:
- jobs
summary: 取消作业
parameters:
- name: jobId
in: path
required: true
schema:
type: string
responses:
'200':
description: 取消成功
/api/v1/jobs/{jobId}/logs:
get:
tags:
- jobs
summary: 获取作业日志
parameters:
- name: jobId
in: path
required: true
schema:
type: string
- name: follow
in: query
description: 是否实时跟踪日志
schema:
type: boolean
default: false
responses:
'200':
description: 获取成功
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/JobLog'
/api/v1/jobs/{jobId}/retry:
post:
tags:
- jobs
summary: 重试作业
parameters:
- name: jobId
in: path
required: true
schema:
type: string
responses:
'200':
description: 重试成功
content:
application/json:
schema:
$ref: '#/components/schemas/JobResponse'
/api/v1/executors:
get:
tags:
- executors
summary: 获取执行器列表
responses:
'200':
description: 获取成功
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ExecutorResponse'
post:
tags:
- executors
summary: 注册执行器
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegisterExecutorRequest'
responses:
'201':
description: 注册成功
/api/v1/executors/{executorId}:
get:
tags:
- executors
summary: 获取执行器详情
parameters:
- name: executorId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/ExecutorDetailResponse'
put:
tags:
- executors
summary: 更新执行器
parameters:
- name: executorId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateExecutorRequest'
responses:
'200':
description: 更新成功
/api/v1/resources/clusters:
get:
tags:
- resources
summary: 获取集群信息
responses:
'200':
description: 获取成功
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ClusterInfo'
/api/v1/resources/nodes:
get:
tags:
- resources
summary: 获取节点信息
parameters:
- name: clusterId
in: query
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/NodeInfo'
/api/v1/monitoring/metrics:
get:
tags:
- monitoring
summary: 获取监控指标
parameters:
- name: metric
in: query
schema:
type: string
- name: start
in: query
schema:
type: string
format: date-time
- name: end
in: query
schema:
type: string
format: date-time
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/MetricsResponse'
components:
schemas:
JobResponse:
type: object
properties:
id:
type: string
name:
type: string
status:
$ref: '#/components/schemas/JobStatus'
executorType:
$ref: '#/components/schemas/ExecutorType'
priority:
type: integer
progress:
type: number
format: double
submittedAt:
type: string
format: date-time
startedAt:
type: string
format: date-time
completedAt:
type: string
format: date-time
submittedBy:
type: string
JobDetailResponse:
allOf:
- $ref: '#/components/schemas/JobResponse'
- type: object
properties:
configuration:
$ref: '#/components/schemas/JobConfiguration'
resources:
$ref: '#/components/schemas/ResourceRequirement'
metrics:
$ref: '#/components/schemas/JobMetrics'
artifacts:
type: array
items:
$ref: '#/components/schemas/JobArtifact'
dependencies:
type: array
items:
type: string
JobPageResponse:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/JobResponse'
totalElements:
type: integer
format: int64
totalPages:
type: integer
size:
type: integer
number:
type: integer
SubmitJobRequest:
type: object
required:
- name
- executorType
- configuration
properties:
name:
type: string
description:
type: string
executorType:
$ref: '#/components/schemas/ExecutorType'
priority:
type: integer
minimum: 1
maximum: 10
default: 5
configuration:
$ref: '#/components/schemas/JobConfiguration'
resources:
$ref: '#/components/schemas/ResourceRequirement'
dependencies:
type: array
items:
type: string
timeoutSeconds:
type: integer
JobConfiguration:
type: object
properties:
script:
type: string
description: 执行脚本或代码
arguments:
type: array
items:
type: string
description: 执行参数
environment:
type: object
description: 环境变量
files:
type: array
items:
$ref: '#/components/schemas/FileReference'
packages:
type: array
items:
type: string
description: 依赖包列表
ResourceRequirement:
type: object
properties:
cpuCores:
type: number
format: double
memoryGB:
type: number
format: double
gpuCount:
type: integer
diskGB:
type: number
format: double
nodeSelector:
type: object
description: 节点选择器
ExecutorResponse:
type: object
properties:
id:
type: string
name:
type: string
type:
$ref: '#/components/schemas/ExecutorType'
status:
$ref: '#/components/schemas/ExecutorStatus'
version:
type: string
capabilities:
type: array
items:
type: string
registeredAt:
type: string
format: date-time
lastHeartbeat:
type: string
format: date-time
ExecutorDetailResponse:
allOf:
- $ref: '#/components/schemas/ExecutorResponse'
- type: object
properties:
configuration:
type: object
resources:
$ref: '#/components/schemas/ExecutorResources'
currentJobs:
type: array
items:
$ref: '#/components/schemas/JobResponse'
statistics:
$ref: '#/components/schemas/ExecutorStatistics'
RegisterExecutorRequest:
type: object
required:
- name
- type
- endpoint
properties:
name:
type: string
type:
$ref: '#/components/schemas/ExecutorType'
endpoint:
type: string
capabilities:
type: array
items:
type: string
configuration:
type: object
UpdateExecutorRequest:
type: object
properties:
status:
$ref: '#/components/schemas/ExecutorStatus'
configuration:
type: object
ClusterInfo:
type: object
properties:
id:
type: string
name:
type: string
type:
type: string
enum: [RAY, KUBERNETES, YARN, STANDALONE]
status:
type: string
enum: [ACTIVE, INACTIVE, ERROR]
nodeCount:
type: integer
totalCpuCores:
type: integer
totalMemoryGB:
type: number
format: double
totalGpuCount:
type: integer
availableResources:
$ref: '#/components/schemas/ResourceInfo'
NodeInfo:
type: object
properties:
id:
type: string
name:
type: string
clusterId:
type: string
status:
type: string
enum: [ACTIVE, INACTIVE, BUSY, ERROR]
resources:
$ref: '#/components/schemas/ResourceInfo'
usage:
$ref: '#/components/schemas/ResourceUsage'
lastUpdate:
type: string
format: date-time
MetricsResponse:
type: object
properties:
metric:
type: string
dataPoints:
type: array
items:
$ref: '#/components/schemas/MetricDataPoint'
aggregation:
type: object
JobLog:
type: object
properties:
timestamp:
type: string
format: date-time
level:
type: string
enum: [DEBUG, INFO, WARN, ERROR]
source:
type: string
message:
type: string
JobMetrics:
type: object
properties:
cpuUsage:
type: number
format: double
memoryUsage:
type: number
format: double
diskUsage:
type: number
format: double
networkIO:
type: object
duration:
type: integer
format: int64
JobArtifact:
type: object
properties:
id:
type: string
name:
type: string
type:
type: string
enum: [LOG, OUTPUT, CHECKPOINT, MODEL]
size:
type: integer
format: int64
path:
type: string
createdAt:
type: string
format: date-time
FileReference:
type: object
properties:
name:
type: string
path:
type: string
type:
type: string
enum: [LOCAL, HDFS, S3, HTTP]
ExecutorResources:
type: object
properties:
total:
$ref: '#/components/schemas/ResourceInfo'
available:
$ref: '#/components/schemas/ResourceInfo'
allocated:
$ref: '#/components/schemas/ResourceInfo'
ExecutorStatistics:
type: object
properties:
totalJobs:
type: integer
successfulJobs:
type: integer
failedJobs:
type: integer
averageExecutionTime:
type: number
format: double
uptime:
type: integer
format: int64
ResourceInfo:
type: object
properties:
cpuCores:
type: number
format: double
memoryGB:
type: number
format: double
gpuCount:
type: integer
diskGB:
type: number
format: double
ResourceUsage:
type: object
properties:
cpuUsagePercent:
type: number
format: double
memoryUsagePercent:
type: number
format: double
diskUsagePercent:
type: number
format: double
MetricDataPoint:
type: object
properties:
timestamp:
type: string
format: date-time
value:
type: number
format: double
tags:
type: object
JobStatus:
type: string
enum:
- SUBMITTED
- PENDING
- RUNNING
- COMPLETED
- FAILED
- CANCELLED
- TIMEOUT
ExecutorType:
type: string
enum:
- RAY
- DATAX
- PYTHON
- SPARK
- FLINK
- CUSTOM
ExecutorStatus:
type: string
enum:
- ACTIVE
- INACTIVE
- BUSY
- ERROR
- MAINTENANCE
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- BearerAuth: []

View File

@@ -0,0 +1,547 @@
openapi: 3.0.1
info:
title: Operator Market Service API
description: |
算子市场服务API,提供算子的发布、管理和订阅功能。
主要功能:
- 算子发布和管理
- 算子版本控制
- 算子评分和评论
- 算子分类和标签
- 算子下载和安装
version: 1.0.0
tags:
- name: Operator
- name: Category
- name: Label
paths:
/operators/list:
post:
summary: 获取算子列表
deprecated: false
description: 分页查询算子列表,支持按分类、标签等条件筛选
tags:
- Operator
parameters: []
requestBody:
content:
application/json:
schema:
type: object
properties:
page:
type: integer
description: 页数
size:
type: integer
description: 单页数量
categories:
type: array
items:
type: integer
description: 分类id列表
operatorName:
type: string
description: 算子名称
labelName:
type: string
description: 标签名称
isStar:
type: boolean
description: 是否收藏
required:
- page
- size
- categories
examples: {}
responses:
'200':
description: 成功返回算子列表
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OperatorResponse'
headers: {}
security: []
/operators/create:
post:
summary: 创建新算子
deprecated: false
description: 创建并发布一个新的算子
tags:
- Operator
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOperatorRequest'
example: null
responses:
'201':
description: 算子创建成功
content:
application/json:
schema: &ref_0
$ref: '#/components/schemas/OperatorResponse'
headers: {}
security: []
/operators/upload:
post:
summary: 上传新算子
deprecated: false
description: 创建并发布一个新的算子
tags:
- Operator
parameters: []
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
example: ''
description:
type: string
example: ''
examples: {}
responses:
'201':
description: 算子创建成功
content:
application/json:
schema: *ref_0
headers: {}
security: []
/operators/{id}:
get:
summary: 获取算子详情
deprecated: false
description: 根据ID获取算子的详细信息
tags:
- Operator
parameters:
- name: id
in: path
description: 算子ID
required: true
example: ''
schema:
type: string
responses:
'200':
description: 成功返回算子详情
content:
application/json:
schema: *ref_0
headers: {}
'404':
description: 算子不存在
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers: {}
security: []
put:
summary: 更新算子信息
deprecated: false
description: 根据ID更新算子信息
tags:
- Operator
parameters:
- name: id
in: path
description: 算子ID
required: true
example: ''
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateOperatorRequest'
example: null
responses:
'200':
description: 算子更新成功
content:
application/json:
schema: *ref_0
headers: {}
security: []
/category:
post:
summary: 创建算子分类
deprecated: false
description: ''
tags:
- Category
parameters: []
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: 名称
parentId:
type: integer
description: 父分类id
required:
- name
- parentId
responses:
'201':
description: ''
headers: {}
security: []
delete:
summary: 删除算子分类
deprecated: false
description: ''
tags:
- Category
parameters: []
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
type: integer
description: ID 编号
required:
- id
responses:
'204':
description: ''
headers: {}
security: []
/categories/tree:
get:
summary: 获取算子分类列表
deprecated: false
description: 获取所有可用的算子分类
tags:
- Category
parameters: []
responses:
'200':
description: 成功返回分类列表
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
name:
type: string
count:
type: integer
categories:
$ref: '#/components/schemas/CategoryResponse'
required:
- id
- name
- count
- categories
headers: {}
security: []
/labels:
get:
summary: 获取算子标签列表
deprecated: false
description: 获取所有算子的标签
tags:
- Label
parameters:
- name: page
in: query
description: 页码,从0开始
required: false
schema:
type: integer
default: 0
- name: size
in: query
description: 每页大小
required: false
schema:
type: integer
default: 20
- name: keyword
in: query
description: 关键词搜索
required: false
schema:
type: string
responses:
'200':
description: 成功返回标签列表
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/LabelResponse'
headers: {}
security: []
post:
summary: 创建标签
deprecated: false
description: 批量创建标签
tags:
- Label
parameters: []
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: 名称
required:
- name
example: veniam
responses:
'201':
description: 创建成功
headers: {}
security: []
delete:
summary: 删除标签
deprecated: false
description: 批量删除标签
tags:
- Label
parameters: []
requestBody:
content:
application/json:
schema:
type: array
items:
type: integer
format: int64
description: 标签id列表
example: null
responses:
'204':
description: 删除成功
headers: {}
security: []
/labels/{id}:
put:
summary: 更新标签
deprecated: false
description: 更新标签
tags:
- Label
parameters:
- name: id
in: path
description: 标签ID
required: true
example: ''
schema:
type: string
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UpdateLabelRequest'
example: null
responses:
'200':
description: 更新成功
headers: {}
security: []
components:
schemas:
UpdateLabelRequest:
type: object
required:
- id
- name
properties:
id:
type: integer
description: 标签id
name:
type: string
description: 标签名称
Response:
type: object
properties:
code:
type: string
message:
type: string
data:
type: object
properties: {}
required:
- code
- message
- data
LabelResponse:
type: object
properties:
id:
type: string
description: 标签ID
name:
type: string
description: 标签名称
SubCategory:
type: object
properties:
id:
type: integer
description: 分类id
name:
type: string
description: 分类名称
count:
type: integer
type:
type: string
description: 分类类型(0:预置,1:自定义)
parentId:
type: integer
description: 父分类id
required:
- id
- name
- type
- parentId
- count
CategoryResponse:
type: array
items:
$ref: '#/components/schemas/SubCategory'
UpdateOperatorRequest:
type: object
properties:
name:
type: string
description: 算子名称
description:
type: string
description: 算子描述
version:
type: string
description: 算子版本
category:
type: string
description: 算子分类
documentation:
type: string
description: 文档内容
ErrorResponse:
type: object
properties:
error:
type: string
description: 错误代码
message:
type: string
description: 错误信息
timestamp:
type: string
format: date-time
description: 错误时间
OperatorResponse:
type: object
properties:
id:
type: string
description: 算子ID
name:
type: string
description: 算子名称
description:
type: string
description: 算子描述
version:
type: string
description: 算子版本
inputs:
type: string
description: 输入类型
outputs:
type: string
description: 输入类型
categories:
type: array
description: 算子分类列表
items:
type: integer
runtime:
type: string
description: 运行时设置
settings:
type: string
description: 算子参数
isStar:
type: boolean
description: 是否收藏
createdAt:
type: string
format: date-time
description: 创建时间
updatedAt:
type: string
format: date-time
description: 更新时间
required:
- language
- modal
- inputs
- outputs
- runtime
- settings
- isStar
CreateOperatorRequest:
type: object
required:
- name
- description
- version
- category
properties:
name:
type: string
description: 算子名称
description:
type: string
description: 算子描述
version:
type: string
description: 算子版本
category:
type: string
description: 算子分类
documentation:
type: string
description: 文档内容
securitySchemes: {}
servers: []

View File

@@ -0,0 +1,639 @@
openapi: 3.0.3
info:
title: Pipeline Orchestration Service API
description: 流程编排服务API - 可视化、模板、执行计划
version: 1.0.0
contact:
name: Data Mate Platform Team
servers:
- url: http://localhost:8087
description: Development server
tags:
- name: pipelines
description: 流水线管理
- name: pipeline-templates
description: 流水线模板
- name: executions
description: 执行管理
- name: workflows
description: 工作流编排
paths:
/api/v1/pipelines:
get:
tags:
- pipelines
summary: 获取流水线列表
parameters:
- name: page
in: query
schema:
type: integer
default: 0
- name: size
in: query
schema:
type: integer
default: 20
- name: status
in: query
schema:
$ref: '#/components/schemas/PipelineStatus'
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/PipelinePageResponse'
post:
tags:
- pipelines
summary: 创建流水线
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePipelineRequest'
responses:
'201':
description: 创建成功
content:
application/json:
schema:
$ref: '#/components/schemas/PipelineResponse'
/api/v1/pipelines/{pipelineId}:
get:
tags:
- pipelines
summary: 获取流水线详情
parameters:
- name: pipelineId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/PipelineDetailResponse'
put:
tags:
- pipelines
summary: 更新流水线
parameters:
- name: pipelineId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdatePipelineRequest'
responses:
'200':
description: 更新成功
/api/v1/pipelines/{pipelineId}/execute:
post:
tags:
- executions
summary: 执行流水线
parameters:
- name: pipelineId
in: path
required: true
schema:
type: string
requestBody:
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/ExecutePipelineRequest'
responses:
'200':
description: 执行开始
content:
application/json:
schema:
$ref: '#/components/schemas/PipelineExecutionResponse'
/api/v1/executions:
get:
tags:
- executions
summary: 获取执行历史
parameters:
- name: pipelineId
in: query
schema:
type: string
- name: status
in: query
schema:
$ref: '#/components/schemas/ExecutionStatus'
- name: page
in: query
schema:
type: integer
default: 0
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/ExecutionPageResponse'
/api/v1/executions/{executionId}:
get:
tags:
- executions
summary: 获取执行详情
parameters:
- name: executionId
in: path
required: true
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
$ref: '#/components/schemas/ExecutionDetailResponse'
/api/v1/executions/{executionId}/stop:
post:
tags:
- executions
summary: 停止执行
parameters:
- name: executionId
in: path
required: true
schema:
type: string
responses:
'200':
description: 停止成功
/api/v1/templates:
get:
tags:
- pipeline-templates
summary: 获取模板列表
parameters:
- name: category
in: query
schema:
type: string
responses:
'200':
description: 获取成功
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/PipelineTemplateResponse'
post:
tags:
- pipeline-templates
summary: 创建模板
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePipelineTemplateRequest'
responses:
'201':
description: 创建成功
components:
schemas:
PipelineResponse:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
status:
$ref: '#/components/schemas/PipelineStatus'
version:
type: string
category:
type: string
tags:
type: array
items:
type: string
createdBy:
type: string
createdAt:
type: string
format: date-time
lastModified:
type: string
format: date-time
PipelineDetailResponse:
allOf:
- $ref: '#/components/schemas/PipelineResponse'
- type: object
properties:
definition:
$ref: '#/components/schemas/PipelineDefinition'
parameters:
type: array
items:
$ref: '#/components/schemas/PipelineParameter'
dependencies:
type: array
items:
type: string
statistics:
$ref: '#/components/schemas/PipelineStatistics'
PipelinePageResponse:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/PipelineResponse'
totalElements:
type: integer
format: int64
totalPages:
type: integer
size:
type: integer
number:
type: integer
CreatePipelineRequest:
type: object
required:
- name
- definition
properties:
name:
type: string
description:
type: string
category:
type: string
definition:
$ref: '#/components/schemas/PipelineDefinition'
parameters:
type: array
items:
$ref: '#/components/schemas/PipelineParameter'
tags:
type: array
items:
type: string
UpdatePipelineRequest:
type: object
properties:
name:
type: string
description:
type: string
definition:
$ref: '#/components/schemas/PipelineDefinition'
status:
$ref: '#/components/schemas/PipelineStatus'
ExecutePipelineRequest:
type: object
properties:
parameters:
type: object
description: 执行参数
environment:
type: string
description: 执行环境
priority:
type: integer
description: 优先级
PipelineExecutionResponse:
type: object
properties:
executionId:
type: string
pipelineId:
type: string
status:
$ref: '#/components/schemas/ExecutionStatus'
startTime:
type: string
format: date-time
message:
type: string
ExecutionResponse:
type: object
properties:
id:
type: string
pipelineId:
type: string
pipelineName:
type: string
status:
$ref: '#/components/schemas/ExecutionStatus'
progress:
type: number
format: double
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
duration:
type: integer
format: int64
description: 执行时长(毫秒)
ExecutionDetailResponse:
allOf:
- $ref: '#/components/schemas/ExecutionResponse'
- type: object
properties:
steps:
type: array
items:
$ref: '#/components/schemas/ExecutionStep'
logs:
type: array
items:
$ref: '#/components/schemas/ExecutionLog'
metrics:
$ref: '#/components/schemas/ExecutionMetrics'
artifacts:
type: array
items:
$ref: '#/components/schemas/ExecutionArtifact'
ExecutionPageResponse:
type: object
properties:
content:
type: array
items:
$ref: '#/components/schemas/ExecutionResponse'
totalElements:
type: integer
format: int64
totalPages:
type: integer
size:
type: integer
number:
type: integer
PipelineTemplateResponse:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
category:
type: string
version:
type: string
definition:
$ref: '#/components/schemas/PipelineDefinition'
usageCount:
type: integer
createdAt:
type: string
format: date-time
CreatePipelineTemplateRequest:
type: object
required:
- name
- definition
properties:
name:
type: string
description:
type: string
category:
type: string
definition:
$ref: '#/components/schemas/PipelineDefinition'
PipelineDefinition:
type: object
properties:
nodes:
type: array
items:
$ref: '#/components/schemas/PipelineNode'
edges:
type: array
items:
$ref: '#/components/schemas/PipelineEdge'
settings:
type: object
description: 流水线设置
PipelineNode:
type: object
properties:
id:
type: string
type:
type: string
enum: [OPERATOR, CONDITION, LOOP, PARALLEL]
name:
type: string
operatorId:
type: string
configuration:
type: object
position:
$ref: '#/components/schemas/NodePosition'
PipelineEdge:
type: object
properties:
id:
type: string
source:
type: string
target:
type: string
condition:
type: string
type:
type: string
enum: [SUCCESS, FAILURE, ALWAYS]
NodePosition:
type: object
properties:
x:
type: number
y:
type: number
PipelineParameter:
type: object
properties:
name:
type: string
type:
type: string
required:
type: boolean
defaultValue:
type: string
description:
type: string
PipelineStatistics:
type: object
properties:
totalExecutions:
type: integer
successfulExecutions:
type: integer
failedExecutions:
type: integer
averageDuration:
type: number
format: double
lastExecutionTime:
type: string
format: date-time
ExecutionStep:
type: object
properties:
id:
type: string
nodeId:
type: string
name:
type: string
status:
$ref: '#/components/schemas/ExecutionStatus'
startTime:
type: string
format: date-time
endTime:
type: string
format: date-time
duration:
type: integer
format: int64
message:
type: string
ExecutionLog:
type: object
properties:
timestamp:
type: string
format: date-time
level:
type: string
enum: [DEBUG, INFO, WARN, ERROR]
nodeId:
type: string
message:
type: string
ExecutionMetrics:
type: object
properties:
totalNodes:
type: integer
completedNodes:
type: integer
failedNodes:
type: integer
cpuUsage:
type: number
format: double
memoryUsage:
type: number
format: double
throughput:
type: number
format: double
ExecutionArtifact:
type: object
properties:
id:
type: string
name:
type: string
type:
type: string
size:
type: integer
format: int64
path:
type: string
createdAt:
type: string
format: date-time
PipelineStatus:
type: string
enum:
- DRAFT
- ACTIVE
- INACTIVE
- DEPRECATED
ExecutionStatus:
type: string
enum:
- PENDING
- RUNNING
- SUCCESS
- FAILED
- CANCELLED
- SKIPPED
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
security:
- BearerAuth: []