- 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
27 lines
725 B
Go
27 lines
725 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
wsApp "github.com/echochat/backend/app/ws"
|
|
"github.com/echochat/backend/pkg/logs"
|
|
)
|
|
|
|
type OnlineManageService struct {
|
|
onlineService *wsApp.OnlineService
|
|
}
|
|
|
|
func NewOnlineManageService(onlineService *wsApp.OnlineService) *OnlineManageService {
|
|
return &OnlineManageService{onlineService: onlineService}
|
|
}
|
|
|
|
func (s *OnlineManageService) GetOnlineUsers(ctx context.Context) ([]int64, error) {
|
|
funcName := "service.online_manage_service.GetOnlineUsers"
|
|
logs.Debug(ctx, funcName, "获取在线用户列表")
|
|
return s.onlineService.GetOnlineUserIDs(ctx)
|
|
}
|
|
|
|
func (s *OnlineManageService) GetOnlineCount(ctx context.Context) (int64, error) {
|
|
return s.onlineService.GetOnlineCount(ctx)
|
|
}
|