Files
cwd/docs/api/admin/feature-settings.md
anghunk 12ef5ec9e2 chore: 更新版本号至0.0.8并优化管理界面代码格式
- 将package.json版本从0.0.7更新至0.0.8
- 统一API响应消息为中文"保存成功!"
- 优化Vue组件代码缩进和格式,提升可读性
- 移除冗余的CSS注释代码
2026-01-29 17:40:13 +08:00

97 lines
1.6 KiB
Markdown

# 功能设置相关
管理点赞功能开关的接口。
## 获取功能设置
```
GET /admin/settings/feature
```
获取当前的功能开关配置。
- 方法:`GET`
- 路径:`/admin/settings/feature`
- 鉴权:需要 Bearer Token
**成功响应**
- 状态码:`200`
```json
{
"enableCommentLike": true,
"enableArticleLike": true
}
```
字段说明:
| 字段名 | 类型 | 说明 |
| ------------------ | ------- | ---------------------- |
| `enableCommentLike` | boolean | 是否启用评论点赞功能 |
| `enableArticleLike` | boolean | 是否启用文章点赞功能 |
## 更新功能设置
```
PUT /admin/settings/feature
```
更新功能开关配置。
- 方法:`PUT`
- 路径:`/admin/settings/feature`
- 鉴权:需要 Bearer Token
**请求头**
| 名称 | 必填 | 示例 |
| -------------- | ---- | ------------------ |
| `Content-Type` | 是 | `application/json` |
| `Authorization` | 是 | `Bearer <token>` |
**请求体**
```json
{
"enableCommentLike": true,
"enableArticleLike": true
}
```
字段说明:
| 字段名 | 类型 | 必填 | 说明 |
| ------------------ | ------- | ---- | ---------------------- |
| `enableCommentLike` | boolean | 否 | 是否启用评论点赞功能 |
| `enableArticleLike` | boolean | 否 | 是否启用文章点赞功能 |
**成功响应**
- 状态码:`200`
```json
{
"message": "保存成功!"
}
```
**错误响应**
- 状态码:`401`
```json
{
"message": "Unauthorized"
}
```
- 状态码:`500`
```json
{
"message": "Failed to save feature settings"
}
```