feat(admin): 管理端在线监控 + 好友关系管理后端

- admin/service/online_service.go: 在线用户列表/计数
- admin/controller/online_controller.go: GET /admin/online/users|count
- admin/service/contact_manage_service.go: 好友关系分页查询/管理员删除
- admin/controller/contact_manage_controller.go: GET|DELETE /admin/contacts
- 更新 admin router/provider/wire 集成新控制器

Made-with: Cursor
This commit is contained in:
bujinyuan
2026-03-02 17:13:06 +08:00
parent 1c87a466a1
commit a77669ee99
9 changed files with 215 additions and 11 deletions

View File

@@ -48,11 +48,15 @@ func InitializeApp(cfg *config.Config) (*App, error) {
hub := ws.ProvideHub()
pubSub := ws.ProvidePubSub(client, hub)
onlineService := ws.ProvideOnlineService(client, hub, pubSub)
onlineManageService := service2.NewOnlineManageService(onlineService)
onlineController := controller2.NewOnlineController(onlineManageService)
contactManageService := service2.NewContactManageService(gormDB)
contactManageController := controller2.NewContactManageController(contactManageService)
handler := ws.ProvideWSHandler(hub, pubSub, jwtConfig, onlineService)
friendshipDAO := dao3.NewFriendshipDAO(gormDB)
friendGroupDAO := dao3.NewFriendGroupDAO(gormDB)
contactService := service3.NewContactService(friendshipDAO, friendGroupDAO, pubSub)
contactController := controller3.NewContactController(contactService)
app := NewApp(cfg, gormDB, client, authService, authController, adminAuthController, userManageController, handler, hub, pubSub, onlineService, contactController)
app := NewApp(cfg, gormDB, client, authService, authController, adminAuthController, userManageController, onlineController, contactManageController, handler, hub, pubSub, onlineService, contactController)
return app, nil
}