feat(call): integrate call handling and WebSocket support
- Added CallHandler and related services for managing call sessions and participants. - Enhanced WSHandler to support call signaling, including invite, answer, reject, and end functionalities. - Updated router to include call-related routes for history and ICE server retrieval. - Introduced WebRTC configuration in the application settings for call management. - Refactored wire generation to include CallService and CallRepository for improved dependency injection.
This commit is contained in:
@@ -34,6 +34,7 @@ type Router struct {
|
||||
adminLogHandler *handler.AdminLogHandler
|
||||
qrcodeHandler *handler.QRCodeHandler
|
||||
materialHandler *handler.MaterialHandler
|
||||
callHandler *handler.CallHandler
|
||||
wsHandler *handler.WSHandler
|
||||
logService *service.LogService
|
||||
jwtService *service.JWTService
|
||||
@@ -65,6 +66,7 @@ func New(
|
||||
adminLogHandler *handler.AdminLogHandler,
|
||||
qrcodeHandler *handler.QRCodeHandler,
|
||||
materialHandler *handler.MaterialHandler,
|
||||
callHandler *handler.CallHandler,
|
||||
logService *service.LogService,
|
||||
activityService service.UserActivityService,
|
||||
casbinService service.CasbinService,
|
||||
@@ -99,6 +101,7 @@ func New(
|
||||
adminLogHandler: adminLogHandler,
|
||||
qrcodeHandler: qrcodeHandler,
|
||||
materialHandler: materialHandler,
|
||||
callHandler: callHandler,
|
||||
logService: logService,
|
||||
jwtService: jwtService,
|
||||
casbinService: casbinService,
|
||||
@@ -335,6 +338,16 @@ func (r *Router) setupRoutes() {
|
||||
realtime.GET("/ws", r.wsHandler.HandleWebSocket)
|
||||
}
|
||||
|
||||
// 通话路由
|
||||
if r.callHandler != nil {
|
||||
calls := v1.Group("/calls")
|
||||
calls.Use(authMiddleware)
|
||||
{
|
||||
calls.GET("/history", r.callHandler.GetCallHistory)
|
||||
calls.GET("/ice-servers", r.callHandler.GetICEServers)
|
||||
}
|
||||
}
|
||||
|
||||
// 消息操作路由
|
||||
messages := v1.Group("/messages")
|
||||
messages.Use(authMiddleware)
|
||||
|
||||
Reference in New Issue
Block a user