添加:ZHub 管理接口文档和客户端使用指南

This commit is contained in:
2025-09-23 21:48:31 +08:00
parent 88011cf20b
commit 5af775e525
35 changed files with 4133 additions and 412 deletions

View File

@@ -0,0 +1,61 @@
---
sidebar_position: 0
title: 管理接口概览
description: ZHub 服务管理接口总览
---
# ZHub 管理接口概览
管理接口通过 HTTP 访问,默认端口 `711`
**配置**:在 `app.ini` 中修改 `[service]` 部分的 `watch` 参数
## 接口列表
**核心接口**
- `GET /_/info` - 查看服务状态
- `GET /_/cleanup` - 清理内存
- `GET /timer/reload` - 重载定时配置
- `GET /auth/reload` - 重载权限配置
**辅助接口**
- `GET /_/version` - 查看版本信息
- `POST /message/send` - HTTP 发送消息
- `GET /topic/delay` - 查看延时消息状态
## 使用示例
```bash
# 查看服务状态
curl http://127.0.0.1:711/_/info
# 清理内存
curl http://127.0.0.1:711/_/cleanup
# 重载配置
curl http://127.0.0.1:711/timer/reload
curl http://127.0.0.1:711/auth/reload
# 查看版本
curl http://127.0.0.1:711/_/version
```
## 配置管理
**端口配置**
```ini
[service]
watch = 0.0.0.0:711 # 管理端口
```
## 安全注意事项
- 管理接口默认监听所有网络接口
- 生产环境建议添加认证机制
- 避免在公网环境暴露管理接口
## 监控建议
- 定期检查服务状态:`/_/info`
- 监控内存使用,必要时执行清理
- 修改配置后及时执行 reload 接口