datai/datai-scenes/datai-scene-salesforce/docs/api-docs/partner-api/PartnerAdvancedController/002-empty-recycle-bin.md

157 lines
3.5 KiB
Markdown
Raw Normal View History

# API 文档 - 清空回收站
## 元数据
- 需求编号001
- 子需求编号001-01
- 接口编号002
- 创建时间2026-02-02
- 创建人AI Assistant
- 状态:已完成
## 接口概述
永久删除 Salesforce 回收站中的记录,释放存储空间。
## 基本信息
- **功能描述**:永久删除回收站中的记录
- **请求方式**POST
- **请求路径**`/partner/advanced/empty-recycle-bin`
- **权限要求**`@PreAuthorize("@ss.hasPermi('partner:advanced:emptyRecycleBin')")`
## 请求参数
### 请求体JSON
| 参数名 | 类型 | 必填 | 说明 | 示例值 |
|--------|------|------|------|--------|
| ids | Array[String] | 是 | 记录 ID 列表(最多 200 个) | ["001xx0000001Gw2EAA", "001xx0000001Gw3EAA"] |
### 请求示例
```json
{
"ids": [
"001xx0000001Gw2EAA",
"001xx0000001Gw3EAA",
"001xx0000001Gw4EAA"
]
}
```
## 响应参数
| 参数名 | 类型 | 说明 |
|--------|------|------|
| code | Integer | 状态码200 成功,其他失败) |
| msg | String | 提示信息 |
| data | Object | 响应数据 |
| data.results | Array | 结果列表 |
| data.results[].id | String | 记录 ID |
| data.results[].success | Boolean | 是否成功 |
| data.results[].errors | Array | 错误信息列表 |
| data.success | Boolean | 是否全部成功 |
| data.errors | Array | 整体错误信息列表 |
### 成功响应示例
```json
{
"code": 200,
"msg": "操作成功",
"data": {
"results": [
{
"id": "001xx0000001Gw2EAA",
"success": true,
"errors": null
},
{
"id": "001xx0000001Gw3EAA",
"success": true,
"errors": null
},
{
"id": "001xx0000001Gw4EAA",
"success": true,
"errors": null
}
],
"success": true,
"errors": null
}
}
```
### 部分失败响应示例
```json
{
"code": 200,
"msg": "操作成功",
"data": {
"results": [
{
"id": "001xx0000001Gw2EAA",
"success": true,
"errors": null
},
{
"id": "001xx0000001Gw3EAA",
"success": false,
"errors": [
{
"statusCode": "INVALID_ID_FIELD",
"message": "Invalid ID field",
"fields": ["id"]
}
]
}
],
"success": false,
"errors": null
}
}
```
### 失败响应示例
```json
{
"code": 500,
"msg": "清空回收站失败",
"data": {
"results": null,
"success": false,
"errors": [
{
"statusCode": "INVALID_OPERATION",
"message": "Cannot delete records that are not in the recycle bin"
}
]
}
}
```
## 错误码
| 错误码 | 说明 | 处理建议 |
|--------|------|----------|
| 200 | 操作成功 | - |
| 400 | 请求参数错误 | 检查请求参数格式和必填项 |
| 401 | 未登录或登录已过期 | 请重新登录 |
| 403 | 无权限访问 | 请检查用户权限 |
| 500 | 服务器内部错误 | 请联系管理员或稍后重试 |
## 注意事项
1. 此操作是永久删除,无法恢复,请谨慎操作
2. 只能删除回收站中的记录,不能删除未删除的记录
3. 单次最多删除 200 条记录
4. 某些记录可能因为权限限制或其他原因无法删除
5. 删除操作是原子性的,每条记录独立处理
## 相关文档
- [需求文档](../../requirements/2026-01-28-001-PartnerAPI源org实现.md)
- [设计文档](../../design/2026-01-29-001-01-认证和会话管理-设计.md)
- [决策记录](../../decisions/2026-01-29-001-01-ADR-认证和会话管理技术选型.md)