OnCall 告警系统

飞书告警与排班管理

仅消息模式
当前时间

15:32:41

今日值班

暂无排班

排班人员

暂无人员

加急时段

工作日 21:00-10:00

节假日全天

快速测试
排班日历
202512
周日
周一
周二
周三
周四
周五
周六
1
21:00-10:00
2
21:00-10:00
3
21:00-10:00
4
21:00-10:00
5
21:00-10:00
6
全天加急
7
全天加急
8
今天
21:00-10:00
9
21:00-10:00
10
21:00-10:00
11
21:00-10:00
12
21:00-10:00
13
全天加急
14
全天加急
15
21:00-10:00
16
21:00-10:00
17
21:00-10:00
18
21:00-10:00
19
21:00-10:00
20
全天加急
21
全天加急
22
21:00-10:00
23
21:00-10:00
24
21:00-10:00
25
21:00-10:00
26
21:00-10:00
27
全天加急
28
全天加急
29
21:00-10:00
30
21:00-10:00
31
21:00-10:00
API 接口
POST/api/alert
{
  "content": "告警内容",
  "mode": "auto"
}
POST/api/schedule
{
  "date": "2024-12-05",
  "userIds": ["ou_xxx"]
}
告警记录

暂无告警记录

API 接口
POST/api/alert发送告警

请求参数:

content * - 告警内容(支持 Markdown)
mode - 模式:auto | message_only | urgent_now | rotation
chatId - 自定义群聊 ID
userIds - 自定义加急用户 ID 列表
urgentTypes - 加急类型:app | sms | phone

模式说明:

auto自动判断是否加急,触发完整轮播流程(默认)
message_only仅发送消息,不加急
urgent_now立即加急指定用户,忽略时间规则
rotation强制触发轮播加急

轮播流程:

第一轮:
1. 今日值班人员 → 逐个加急
2. 剩余排班人员 → 逐个加急
第二轮 ~ 第N轮:
全部排班人员 → 逐个加急
直到有人已读或达到最大轮播次数

curl 示例:

# 自动模式(推荐)
curl -X POST http://localhost:3000/api/alert \
  -H "Content-Type: application/json" \
  -d '{"content": "**服务异常**\n服务响应超时"}'

# 仅发送消息
curl -X POST http://localhost:3000/api/alert \
  -H "Content-Type: application/json" \
  -d '{"content": "测试消息", "mode": "message_only"}'

# 立即加急
curl -X POST http://localhost:3000/api/alert \
  -H "Content-Type: application/json" \
  -d '{"content": "紧急!", "mode": "urgent_now", "urgentTypes": ["app", "phone"]}'
GET/api/alert获取当前状态
curl http://localhost:3000/api/alert
GET/api/alerts获取告警记录
curl http://localhost:3000/api/alerts
GET/api/users获取用户列表
curl http://localhost:3000/api/users
GET/api/schedule获取排班列表
curl http://localhost:3000/api/schedule
GET/api/timerules获取时间规则
curl http://localhost:3000/api/timerules