🔔 飞行侠实现:实例注册 + Webhook 推送
新功能: - instances 应用:OpenClaw 实例管理 - Instance 模型:实例注册,Agent 列表,Webhook URL - MeetingInstanceMap:会议 - 实例映射 - Webhook 推送:消息发送时自动通知相关实例 API 端点: - POST /api/v1/instances/register/ - 实例注册 - POST /api/v1/instances/join-meeting/ - 加入会议 - GET /api/v1/instances/ - 实例列表 - POST /api/v1/instances/webhook-test/ - Webhook 测试 集成: - send_message API 自动触发 Webhook 推送 - 支持广播和定向推送 测试: - test_webhook.py: 完整测试流程 使用场景: 1. 每台 OpenClaw 机器注册实例 2. Agent 加入会议时关联实例 3. 消息发送时推送到对应机器 4. 本机 OpenClaw 收到通知,触发 Agent 响应
This commit is contained in:
@@ -46,6 +46,7 @@ INSTALLED_APPS = [
|
||||
"meetings",
|
||||
"users",
|
||||
"api",
|
||||
"instances",
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
||||
@@ -4,6 +4,7 @@ from django.views.generic import TemplateView
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from meetings.views import MeetingViewSet, ParticipantViewSet
|
||||
from users.views import LoginView, RegisterView
|
||||
from instances.views import InstanceRegisterView, MeetingJoinView, InstanceListView, WebhookNotifyView
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register(r'meetings', MeetingViewSet, basename='meeting')
|
||||
@@ -14,6 +15,10 @@ urlpatterns = [
|
||||
path("", TemplateView.as_view(template_name="meeting_room.html"), name="home"),
|
||||
path("api/v1/auth/login/", LoginView.as_view()),
|
||||
path("api/v1/auth/register/", RegisterView.as_view()),
|
||||
path("api/v1/instances/register/", InstanceRegisterView.as_view()),
|
||||
path("api/v1/instances/join-meeting/", MeetingJoinView.as_view()),
|
||||
path("api/v1/instances/", InstanceListView.as_view()),
|
||||
path("api/v1/instances/webhook-test/", WebhookNotifyView.as_view()),
|
||||
re_path(r'^api/v1/meetings/(?P<pk>[^/.]+)/generate-minutes/$', MeetingViewSet.as_view({'get': 'minutes'}), name='meeting-minutes'),
|
||||
path("api/v1/", include(router.urls)),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user