# 软件库模块

软件库控制层 SoftController @author buxia97 @date 2024/06/29

**类路径**：`SoftController`
**前缀**：`/soft`

## 1. categoryList

**接口路径**：`GET/POST /soft/categoryList`

**权限**：公开接口；但当系统配置 isLogin=1 时会强制要求登录

**接口说明**：分类列表

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| searchParams | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |
| page | Integer | 否 | 1 |  |
| searchKey | String | 否 | - |  |
| order | String | 否 | orderKey |  |
| limit | Integer | 否 | 50 |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softCategoryList()  （https://api.ruletree.club/soft/categoryList）

---

## 2. categoryAdd

**接口路径**：`GET/POST /soft/categoryAdd`

**权限**：需要超级管理员权限

**接口说明**：添加分类

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| params | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 3. categoryEdit

**接口路径**：`GET/POST /soft/categoryEdit`

**权限**：需要超级管理员权限

**接口说明**：编辑分类

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| params | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 4. categoryDelete

**接口路径**：`GET/POST /soft/categoryDelete`

**权限**：需要超级管理员权限

**接口说明**：删除分类

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 5. list

**接口路径**：`GET/POST /soft/list`

**权限**：公开接口；但当系统配置 isLogin=1 时会强制要求登录

**接口说明**：软件列表

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| searchParams | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |
| page | Integer | 否 | 1 |  |
| searchKey | String | 否 | - |  |
| order | String | 否 | created |  |
| limit | Integer | 否 | 15 |  |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softList()  （https://api.ruletree.club/soft/list）

---

## 6. info

**接口路径**：`GET/POST /soft/info`

**权限**：公开接口；但当系统配置 isLogin=1 时会强制要求登录

**接口说明**：软件详情

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| key | String | 否 | - |  |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softInfo()  （https://api.ruletree.club/soft/info）

---

## 7. add

**接口路径**：`GET/POST /soft/add`

**权限**：需要超级管理员权限

**接口说明**：添加软件

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| params | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 8. edit

**接口路径**：`GET/POST /soft/edit`

**权限**：需要超级管理员权限

**接口说明**：编辑软件

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| params | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 9. delete

**接口路径**：`GET/POST /soft/delete`

**权限**：需要超级管理员权限

**接口说明**：删除软件

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 10. download

**接口路径**：`GET/POST /soft/download`

**权限**：需要登录（普通用户及以上）

**接口说明**：软件下载（用户端专用） 登录后调用：免费软件直接返回链接；付费软件已购直接返回，未购返回 needBuy 标识

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| softId | Integer | 否 | - |  |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softDownload()  （https://api.ruletree.club/soft/download）

---

## 11. buy

**接口路径**：`GET/POST /soft/buy`

**权限**：需要登录（普通用户及以上）

**接口说明**：付费软件购买（消耗站内资产） 幂等：已购直接返回成功；资产不足返回 INSUFFICIENT；购买成功返回下载链接

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| softId | Integer | 否 | - |  |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softBuy()  （https://api.ruletree.club/soft/buy）

---

## 12. audit

**接口路径**：`GET/POST /soft/audit`

**权限**：需要超级管理员权限

**接口说明**：审核软件

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |
| status | Integer | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 13. recommend

**接口路径**：`GET/POST /soft/recommend`

**权限**：需要超级管理员权限

**接口说明**：推荐/取消推荐

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |
| isRecommend | Integer | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 14. status

**接口路径**：`GET/POST /soft/status`

**权限**：需要超级管理员权限

**接口说明**：上架/下架

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |
| status | Integer | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 15. commentList

**接口路径**：`GET/POST /soft/commentList`

**权限**：公开接口；但当系统配置 isLogin=1 时会强制要求登录

**接口说明**：评论列表

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| searchParams | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |
| page | Integer | 否 | 1 |  |
| searchKey | String | 否 | - |  |
| order | String | 否 | created |  |
| limit | Integer | 否 | 15 |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softCommentList()  （https://api.ruletree.club/soft/commentList）

---

## 16. commentAdd

**接口路径**：`GET/POST /soft/commentAdd`

**权限**：需要登录（普通用户及以上）

**接口说明**：用户提交评分+评论

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| params | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softCommentAdd()  （https://api.ruletree.club/soft/commentAdd）

---

## 17. commentAudit

**接口路径**：`GET/POST /soft/commentAudit`

**权限**：需要超级管理员权限

**接口说明**：审核评论

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |
| status | Integer | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 18. commentDelete

**接口路径**：`GET/POST /soft/commentDelete`

**权限**：需要超级管理员权限

**接口说明**：删除评论

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 19. contributeList

**接口路径**：`GET/POST /soft/contributeList`

**权限**：需要超级管理员权限

**接口说明**：投稿列表（管理员）

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| searchParams | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |
| page | Integer | 否 | 1 |  |
| searchKey | String | 否 | - |  |
| order | String | 否 | created |  |
| limit | Integer | 否 | 15 |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 20. contributeAdd

**接口路径**：`GET/POST /soft/contributeAdd`

**权限**：需要登录（普通用户及以上）

**接口说明**：用户提交投稿

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| params | String（JSON 字符串，需后端解析） | 否 | - | JSON 字符串，需后端解析 |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softContributeAdd()  （https://api.ruletree.club/soft/contributeAdd）

---

## 21. contributeAudit

**接口路径**：`GET/POST /soft/contributeAudit`

**权限**：需要超级管理员权限

**接口说明**：审核投稿

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| id | Integer | 否 | - |  |
| status | Integer | 否 | - |  |
| auditReason | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

---

## 22. contributeMyList

**接口路径**：`GET/POST /soft/contributeMyList`

**权限**：需要登录（普通用户及以上）

**接口说明**：我的投稿列表

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| page | Integer | 否 | 1 |  |
| limit | Integer | 否 | 15 |  |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.softContributeMyList()  （https://api.ruletree.club/soft/contributeMyList）

---

## 23. uploadApk

**接口路径**：`GET/POST /soft/uploadApk`

**权限**：需要超级管理员权限

**接口说明**：上传APK并解析

**请求参数**：

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| file | MultipartFile（文件上传） | 否 | - | 文件上传 |
| token | String | 否 | - |  |

**响应说明**：
```json
{
  "code": 1,
  "msg": "",
  "data": ...
}
```

**前端调用参考**：
- 前端调用：this.$API.upload()  （https://api.ruletree.club/upload/full）

---
