datai/docs/archive/api-docs/integration/DataiIntegrationBatchController/0006-delete-batch.md

117 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 接口文档:删除数据批次
## 接口信息
- **接口名称**: 删除数据批次
- **接口路径**: /integration/batch/{ids}
- **请求方法**: DELETE
- **模块归属**: 数据批次管理
- **版本号**: v1.0
- **创建日期**: 2026-01-09
- **最后更新**: 2026-01-09
## 功能描述
批量删除数据批次根据批次ID列表删除多个批次。
## 请求参数
### 路径参数
| 参数名 | 类型 | 必填 | 描述 | 示例 |
|--------|------|------|------|------|
| ids | Integer[] | 是 | 批次ID数组 | 1,2,3 |
## 响应数据
### 成功响应
**HTTP 状态码**: 200 OK
```json
{
"code": 200,
"message": "操作成功",
"data": 3
}
```
### 失败响应
**HTTP 状态码**: 400/401/500
```json
{
"code": 400,
"message": "参数错误",
"data": 0
}
```
## 接口示例
### 请求示例
```bash
curl -X DELETE "http://localhost:8080/integration/batch/1,2,3" \
-H "Authorization: Bearer [token]"
```
### 响应示例
**成功**:
```json
{
"code": 200,
"message": "操作成功",
"data": 3
}
```
**失败**:
```json
{
"code": 400,
"message": "参数错误",
"data": 0
}
```
## 错误处理
- **401 未授权**: 用户没有访问权限
- **400 参数错误**: 请求参数不完整或格式错误
- **500 服务器错误**: 服务器内部错误,可能是数据库连接失败等
## 注意事项
- 接口需要 `integration:batch:remove` 权限
- 支持批量删除多个批次
- 批次ID必须为整数类型多个ID之间用逗号分隔
## 相关接口
- [查询数据批次列表](http://localhost:8080/integration/batch/list) - 查询数据批次列表
- [获取数据批次详细信息](http://localhost:8080/integration/batch/{id}) - 获取单个数据批次的详细信息
## 实现细节
- 接口通过调用 `dataiIntegrationBatchService.deleteDataiIntegrationBatchByIds()` 方法删除批次
- 支持批量删除多个批次
## 测试信息
### 测试环境
- **环境**: 开发环境
- **版本**: v1.0
### 测试用例
| 测试场景 | 输入参数 | 预期结果 | 实际结果 | 状态 |
|----------|----------|----------|----------|------|
| 删除单个批次 | ids=1 | 操作成功返回1 | 操作成功返回1 | 通过 |
| 删除多个批次 | ids=1,2,3 | 操作成功返回3 | 操作成功返回3 | 通过 |
| 删除不存在批次 | ids=999 | 操作成功返回0 | 操作成功返回0 | 通过 |