feat: add internal workbench admin api

This commit is contained in:
richjohnrambo
2026-09-16 14:03:51 +08:00
parent cf08f7ceeb
commit 21c36abf58
9 changed files with 581 additions and 9 deletions
+11 -1
View File
@@ -14,11 +14,14 @@
- `/v1/workbench/reports/daily*`
- `/v1/workbench/reports/monthly*`
- `/v1/workbench/executive-mailbox/*`
- `/internal/admin/workbench/*`,HotGo 后台内部管理接口,使用服务间 HMAC 鉴权
## 本地运行
```bash
IM_WORKBENCH_CONFIG=configs/workbench.local.json go run ./cmd/workbench
IM_WORKBENCH_CONFIG=configs/workbench.local.json \
IM_WORKBENCH_INTERNAL_SECRET=local-workbench-secret \
go run ./cmd/workbench
```
默认监听 `:6061`,默认连接本地 `tinode` 库和本地 Redis。
@@ -43,6 +46,13 @@ X-Request-ID: {uuid}
服务从 Redis 读取 `im:session:token:{sha256(token)}` 校验登录态。
HotGo 后台访问 `/internal/admin/workbench/*` 时需要配置同一组内部鉴权参数:
```text
IM_WORKBENCH_INTERNAL_SERVICE_NAME=hotgo-admin
IM_WORKBENCH_INTERNAL_SECRET={shared-secret}
```
## Kafka 事件
工作台写操作统一投递到 `im.workbench.event`。本地配置默认关闭 Kafka: