onlinelist.go 747 B

123456789101112131415161718192021222324252627
  1. package service
  2. import (
  3. "context"
  4. daoAnchorV1 "go-common/app/service/live/dao-anchor/api/grpc/v1"
  5. "go-common/library/log"
  6. )
  7. func (s *Service) getOnlineListByAttrs(ctx context.Context, attrs []*daoAnchorV1.AttrReq) (roomList map[int64]*daoAnchorV1.AttrResp, err error){
  8. roomList = make(map[int64]*daoAnchorV1.AttrResp)
  9. RoomOnlineListByAttrsResp, err := s.daoAnchor.RoomOnlineListByAttrs(ctx, &daoAnchorV1.RoomOnlineListByAttrsReq{
  10. Attrs: attrs,
  11. })
  12. if err != nil {
  13. log.Error("[getOnlineListByAttrs]rpc_error:%+v", err)
  14. return
  15. }
  16. if RoomOnlineListByAttrsResp == nil || len(RoomOnlineListByAttrsResp.Attrs) <= 0 {
  17. log.Error("[getOnlineListByAttrs]RoomList_empty")
  18. return
  19. }
  20. roomList = RoomOnlineListByAttrsResp.Attrs
  21. return
  22. }