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:
@@ -27,6 +27,7 @@ var HandlerSet = wire.NewSet(
|
||||
handler.NewAdminLogHandler,
|
||||
handler.NewQRCodeHandler,
|
||||
handler.NewMaterialHandler,
|
||||
handler.NewCallHandler,
|
||||
|
||||
// 需要特殊处理的 Handler
|
||||
ProvideUserHandler,
|
||||
@@ -126,6 +127,7 @@ func ProvideWSHandler(
|
||||
chatService service.ChatService,
|
||||
groupService service.GroupService,
|
||||
jwtService *service.JWTService,
|
||||
callService service.CallService,
|
||||
) *handler.WSHandler {
|
||||
return handler.NewWSHandler(wsHub, chatService, groupService, jwtService)
|
||||
return handler.NewWSHandler(wsHub, chatService, groupService, jwtService, callService)
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ var RepositorySet = wire.NewSet(
|
||||
repository.NewScheduleRepository,
|
||||
repository.NewMaterialSubjectRepository,
|
||||
repository.NewMaterialFileRepository,
|
||||
repository.NewCallRepository,
|
||||
ProvideUserActivityRepository,
|
||||
|
||||
// 日志相关仓储
|
||||
|
||||
@@ -55,6 +55,7 @@ var ServiceSet = wire.NewSet(
|
||||
ProvideQRCodeLoginService,
|
||||
ProvideHotRankWorker,
|
||||
ProvideMaterialService,
|
||||
ProvideCallService,
|
||||
|
||||
// 日志服务
|
||||
ProvideAsyncLogManager,
|
||||
@@ -380,3 +381,12 @@ func ProvideMaterialService(
|
||||
func parseDuration(s string) (time.Duration, error) {
|
||||
return time.ParseDuration(s)
|
||||
}
|
||||
|
||||
// ProvideCallService 提供通话服务
|
||||
func ProvideCallService(
|
||||
callRepo repository.CallRepository,
|
||||
wsHub *ws.Hub,
|
||||
cfg *config.Config,
|
||||
) service.CallService {
|
||||
return service.NewCallService(callRepo, wsHub, cfg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user