feat(call): integrate call handling and WebSocket support
All checks were successful
Build Backend / build (push) Successful in 13m26s
Build Backend / build-docker (push) Successful in 1m22s

- 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:
lafay
2026-03-27 01:54:34 +08:00
parent 9ecb29225a
commit 7e6a65d29d
16 changed files with 1002 additions and 7 deletions

View File

@@ -47,6 +47,7 @@ func ProvideRouter(
adminLogHandler *handler.AdminLogHandler,
qrcodeHandler *handler.QRCodeHandler,
materialHandler *handler.MaterialHandler,
callHandler *handler.CallHandler,
logService *service.LogService,
activityService service.UserActivityService,
casbinService service.CasbinService,
@@ -76,6 +77,7 @@ func ProvideRouter(
adminLogHandler,
qrcodeHandler,
materialHandler,
callHandler,
logService,
activityService,
casbinService,

View File

@@ -117,10 +117,13 @@ func InitializeApp() (*App, error) {
qrCodeHandler := handler.NewQRCodeHandler(qrCodeLoginService)
materialSubjectRepository := repository.NewMaterialSubjectRepository(db)
materialFileRepository := repository.NewMaterialFileRepository(db)
callRepository := repository.NewCallRepository(db)
materialService := wire.ProvideMaterialService(materialSubjectRepository, materialFileRepository)
callService := wire.ProvideCallService(callRepository, hub, config)
materialHandler := handler.NewMaterialHandler(materialService)
wsHandler := wire.ProvideWSHandler(hub, chatService, groupService, jwtService)
router := ProvideRouter(userHandler, postHandler, commentHandler, messageHandler, notificationHandler, uploadHandler, jwtService, pushHandler, systemMessageHandler, groupHandler, stickerHandler, voteHandler, channelHandler, scheduleHandler, roleHandler, adminUserHandler, adminPostHandler, adminCommentHandler, adminGroupHandler, adminDashboardHandler, adminLogHandler, qrCodeHandler, materialHandler, logService, userActivityService, casbinService, wsHandler)
callHandler := handler.NewCallHandler(callService)
wsHandler := wire.ProvideWSHandler(hub, chatService, groupService, jwtService, callService)
router := ProvideRouter(userHandler, postHandler, commentHandler, messageHandler, notificationHandler, uploadHandler, jwtService, pushHandler, systemMessageHandler, groupHandler, stickerHandler, voteHandler, channelHandler, scheduleHandler, roleHandler, adminUserHandler, adminPostHandler, adminCommentHandler, adminGroupHandler, adminDashboardHandler, adminLogHandler, qrCodeHandler, materialHandler, callHandler, logService, userActivityService, casbinService, wsHandler)
hotRankWorker := wire.ProvideHotRankWorker(config, postRepository, cache)
app := NewApp(config, db, router, pushService, hotRankWorker, server, logger)
return app, nil
@@ -153,6 +156,7 @@ func ProvideRouter(
adminLogHandler *handler.AdminLogHandler,
qrcodeHandler *handler.QRCodeHandler,
materialHandler *handler.MaterialHandler,
callHandler *handler.CallHandler,
logService *service.LogService,
activityService service.UserActivityService,
casbinService service.CasbinService,
@@ -182,6 +186,7 @@ func ProvideRouter(
adminLogHandler,
qrcodeHandler,
materialHandler,
callHandler,
logService,
activityService,
casbinService,