This commit is contained in:
2026-10-26 22:42:29 +08:00
parent 6f13816bcf
commit 554f6737cf
9 changed files with 331 additions and 47 deletions
+35 -2
View File
@@ -114,6 +114,39 @@ curl "http://localhost:8080/api/admin/miniapps?status=1&page=1&size=20" \
{ "code": 0, "msg": "ok" }
```
### 1.6 `PUT /api/admin/miniapps/:id/status`
更新小程序状态(启用 / 停用)。
**路径参数**
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `id` | uint64 | 小程序主键。 |
**请求体**
```json
{ "status": 1 }
```
| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `status` | int8 | 是 | 状态:`0` 停用,`1` 启用。仅允许这两个值,非法值返回 `40000`。 |
> 该接口仅更新 `status` 字段,不影响其它字段;常用于停用 / 启用小程序。
**响应**:返回更新后的 `MiniProgram` 对象(见 §2.1),`app_secret` 字段不返回。
**curl 示例**
```bash
curl -X PUT "http://localhost:8080/api/admin/miniapps/1/status" \
-H "Authorization: Bearer <JWT>" \
-H "Content-Type: application/json" \
-d '{"status":0}'
```
## 2. 数据模型
### 2.1 MiniProgram(被纳管小程序)
@@ -127,8 +160,8 @@ curl "http://localhost:8080/api/admin/miniapps?status=1&page=1&size=20" \
| `AppSecret` | string | `app_secret` | **不返回**(json `-`)。 |
| `Status` | int8 | `status` | `0` 停用,`1` 启用。 |
| `Ext` | string | `ext` | 扩展 JSON 文本。 |
| `CreatedAt` | time | `created_at` | 创建时间。 |
| `UpdatedAt` | time | `updated_at` | 更新时间。 |
| `CreatedAt` | time | `created_at` | 创建时间,格式 `Y-m-d H:i:s`(如 `2026-10-26 15:04:05`)。 |
| `UpdatedAt` | time | `updated_at` | 更新时间,格式 `Y-m-d H:i:s`。 |
## 3. 备注