Files
EchoChat/backend/go-service/app/provider/wire_gen.go
bujinyuan 55d6352c6a feat(phase2e-2): 落地 HTTPMediaOrchestrator 打通 Go↔Node 媒体链路(Task 7)
- 新增 MediaServerConfig + config.{dev,docker}.yaml 的 media_server 段
  (base_url / internal_token / timeout_ms / close_timeout_ms / close_retry)
- 新建 HTTPMediaOrchestrator(8 方法 + sync.Map 缓存 roomCode→routerID
  + 关闭类指数退避重试 200/500ms + ErrMediaResourceNotFound/ErrMediaServerError
  两类错误)实现 MediaOrchestrator 接口
- wire 绑定由 NoopMediaOrchestrator 切换到 HTTPMediaOrchestrator;
  MeetingService / MeetingSignalService 调用侧零改动
- E2E 脚本 docs/verify/meeting_t7_verify.mjs 证明 16/16 PASS:
  健康检查/错token 401/REST 创房加入/WS room.join/真实 mediasoup
  transport.create(ICE/DTLS 指纹均由 Node 返回非占位)/404 幂等关 producer
  /host 结束会议触发 CloseRouter
- 同步更新 13 份文档:CURRENT_STATUS / implementation.plan / design
  变更记录 / project-context / api 导览 / api websocket / api frontend meeting
  / system-architecture / media-server README / 顶层 README 等
- go build ./... 全绿

Made-with: Cursor
2026-04-21 17:47:11 +08:00

113 lines
6.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code generated by Wire. DO NOT EDIT.
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package provider
import (
controller2 "github.com/echochat/backend/app/admin/controller"
dao2 "github.com/echochat/backend/app/admin/dao"
service2 "github.com/echochat/backend/app/admin/service"
"github.com/echochat/backend/app/auth/controller"
"github.com/echochat/backend/app/auth/dao"
"github.com/echochat/backend/app/auth/service"
controller3 "github.com/echochat/backend/app/contact/controller"
dao3 "github.com/echochat/backend/app/contact/dao"
service4 "github.com/echochat/backend/app/contact/service"
controller4 "github.com/echochat/backend/app/file/controller"
service5 "github.com/echochat/backend/app/file/service"
controller5 "github.com/echochat/backend/app/group/controller"
dao4 "github.com/echochat/backend/app/group/dao"
service6 "github.com/echochat/backend/app/group/service"
"github.com/echochat/backend/app/im"
controller7 "github.com/echochat/backend/app/meeting/controller"
dao6 "github.com/echochat/backend/app/meeting/dao"
service7 "github.com/echochat/backend/app/meeting/service"
controller6 "github.com/echochat/backend/app/notify/controller"
dao5 "github.com/echochat/backend/app/notify/dao"
service3 "github.com/echochat/backend/app/notify/service"
"github.com/echochat/backend/app/notify/task"
"github.com/echochat/backend/app/ws"
"github.com/echochat/backend/config"
"github.com/echochat/backend/pkg/db"
"github.com/echochat/backend/pkg/storage"
)
// Injectors from wire.go:
// InitializeApp 初始化整个应用Wire 自动生成实现)
func InitializeApp(cfg *config.Config) (*App, error) {
databaseConfig := provideDBConfig(cfg)
gormDB, err := db.NewPostgres(databaseConfig)
if err != nil {
return nil, err
}
redisConfig := provideRedisConfig(cfg)
client, err := db.NewRedis(redisConfig)
if err != nil {
return nil, err
}
minioConfig := provideMinioConfig(cfg)
minioClient, err := storage.NewMinioClient(minioConfig)
if err != nil {
return nil, err
}
userDAO := dao.NewUserDAO(gormDB)
roleDAO := dao.NewRoleDAO(gormDB)
jwtConfig := provideJWTConfig(cfg)
tokenStore := service.NewTokenStore(client, jwtConfig)
authService := service.NewAuthService(userDAO, roleDAO, jwtConfig, tokenStore)
authController := controller.NewAuthController(authService)
adminAuthController := controller.NewAdminAuthController(authService)
userManageDAO := dao2.NewUserManageDAO(gormDB)
userManageService := service2.NewUserManageService(userManageDAO, userDAO, roleDAO)
userManageController := controller2.NewUserManageController(userManageService)
hub := ws.ProvideHub()
pubSub := ws.ProvidePubSub(client, hub)
friendshipDAO := dao3.NewFriendshipDAO(gormDB)
onlineService := ws.ProvideOnlineService(client, hub, pubSub, friendshipDAO)
onlineManageService := service2.NewOnlineManageService(onlineService, gormDB)
onlineController := controller2.NewOnlineController(onlineManageService)
contactManageService := service2.NewContactManageService(gormDB)
contactManageController := controller2.NewContactManageController(contactManageService)
groupDAO := dao4.NewGroupDAO(gormDB)
groupManageService := service2.NewGroupManageService(gormDB, groupDAO)
groupManageController := controller2.NewGroupManageController(groupManageService)
messageManageDAO := dao2.NewMessageManageDAO(gormDB)
conversationDAO := im.ProvideConversationDAO(gormDB)
messageManageService := service2.NewMessageManageService(messageManageDAO, userDAO, conversationDAO, pubSub)
messageManageController := controller2.NewMessageManageController(messageManageService)
handler := ws.ProvideWSHandler(hub, pubSub, jwtConfig, onlineService, authService)
friendGroupDAO := dao3.NewFriendGroupDAO(gormDB)
notificationDAO := dao5.NewNotificationDAO(gormDB)
notifyService := service3.NewNotifyService(notificationDAO, pubSub, friendshipDAO)
contactService := service4.NewContactService(friendshipDAO, friendGroupDAO, onlineService, notifyService)
contactController := controller3.NewContactController(contactService)
messageDAO := im.ProvideMessageDAO(gormDB)
messageReadDAO := dao4.NewMessageReadDAO(gormDB)
imService := im.ProvideIMService(conversationDAO, messageDAO, pubSub, client, friendshipDAO, friendshipDAO, groupDAO, messageReadDAO)
imController := im.ProvideIMController(imService)
eventHandler := im.ProvideIMEventHandler(imService, hub)
offlinePusher := im.ProvideOfflinePusher(imService, conversationDAO, pubSub)
fileService := service5.NewFileService(minioClient, minioConfig)
fileController := controller4.NewFileController(fileService)
joinRequestDAO := dao4.NewJoinRequestDAO(gormDB)
groupService := service6.NewGroupService(groupDAO, joinRequestDAO, friendshipDAO, pubSub, messageDAO, notifyService)
groupController := controller5.NewGroupController(groupService)
notificationController := controller6.NewNotificationController(notifyService)
cleanupTask := task.NewCleanupTask(notificationDAO)
meetingRoomDAO := dao6.NewMeetingRoomDAO(gormDB)
meetingParticipantDAO := dao6.NewMeetingParticipantDAO(gormDB)
meetingChatDAO := dao6.NewMeetingChatDAO(gormDB)
meetingBroadcaster := service7.NewMeetingBroadcaster(meetingParticipantDAO, pubSub)
httpMediaOrchestrator := service7.NewHTTPMediaOrchestrator(cfg)
meetingService := service7.NewMeetingService(meetingRoomDAO, meetingParticipantDAO, meetingChatDAO, gormDB, client, meetingBroadcaster, notifyService, friendshipDAO, onlineService, httpMediaOrchestrator)
meetingSignalService := service7.NewMeetingSignalService(meetingRoomDAO, meetingParticipantDAO, client, meetingBroadcaster, httpMediaOrchestrator)
meetingController := controller7.NewMeetingController(meetingService)
meetingWSHandler := controller7.NewMeetingWSHandler(meetingSignalService, hub)
app := NewApp(cfg, gormDB, client, minioClient, authService, authController, adminAuthController, userManageController, onlineController, contactManageController, groupManageController, messageManageController, handler, hub, pubSub, onlineService, contactController, imController, eventHandler, offlinePusher, fileController, groupController, notifyService, notificationController, cleanupTask, meetingService, meetingSignalService, meetingController, meetingWSHandler)
return app, nil
}