feat(call): integrate LiveKit for voice and video calling
All checks were successful
Build Backend / build (push) Successful in 3m47s
Build Backend / build-docker (push) Successful in 5m9s

Replace the manual WebRTC signaling implementation with LiveKit SFU. This includes:
- Adding LiveKit service, handler, and configuration.
- Updating Docker Compose to include LiveKit server, Redis, and PostgreSQL.
- Refactoring `CallService` and `WSHandler` to support LiveKit room readiness instead of raw SDP/ICE relaying.
- Adding new API endpoints for LiveKit token generation and webhooks.
- Removing deprecated WebRTC configuration and manual signaling DTOs.
This commit is contained in:
2026-06-01 13:41:02 +08:00
parent 9356cb6876
commit 14114db68d
22 changed files with 731 additions and 452 deletions

View File

@@ -1,12 +1,14 @@
package wire
import (
"with_you/internal/config"
"with_you/internal/handler"
"with_you/internal/pkg/ws"
"with_you/internal/repository"
"with_you/internal/service"
"github.com/google/wire"
"go.uber.org/zap"
)
// HandlerSet Handler 层 Provider Set
@@ -29,6 +31,7 @@ var HandlerSet = wire.NewSet(
handler.NewQRCodeHandler,
handler.NewMaterialHandler,
handler.NewCallHandler,
ProvideLiveKitHandler,
handler.NewReportHandler,
handler.NewAdminReportHandler,
handler.NewVerificationHandler,
@@ -106,6 +109,16 @@ func ProvideWSHandler(
return handler.NewWSHandler(publisher, chatService, groupService, jwtService, callService, userRepo)
}
// ProvideLiveKitHandler 提供 LiveKit 处理器
func ProvideLiveKitHandler(
liveKitService service.LiveKitService,
callService service.CallService,
cfg *config.Config,
logger *zap.Logger,
) *handler.LiveKitHandler {
return handler.NewLiveKitHandler(liveKitService, callService, cfg, logger)
}
// ProvideAdminVerificationHandler 提供管理端身份认证处理器
func ProvideAdminVerificationHandler(
adminVerificationService service.AdminVerificationService,

View File

@@ -62,6 +62,7 @@ var ServiceSet = wire.NewSet(
ProvideHotRankWorker,
ProvideMaterialService,
ProvideCallService,
ProvideLiveKitService,
ProvideReportService,
ProvideAdminReportService,
ProvideVerificationService,
@@ -463,6 +464,14 @@ func ProvideCallService(
return service.NewCallService(callRepo, publisher, cfg, db, redisClient)
}
// ProvideLiveKitService 提供 LiveKit 服务
func ProvideLiveKitService(
cfg *config.Config,
logger *zap.Logger,
) service.LiveKitService {
return service.NewLiveKitService(cfg, logger)
}
// ProvideReportService 提供举报服务
func ProvideReportService(
reportRepo repository.ReportRepository,