operate.go 694 B

1234567891011121314151617181920212223242526272829303132
  1. package feed
  2. import (
  3. "context"
  4. "go-common/app/interface/main/app-card/model"
  5. "go-common/app/interface/main/app-card/model/card/operate"
  6. )
  7. // channelRcmdCard is.
  8. func (s *Service) channelRcmdCard(c context.Context, ids ...int64) (cardm map[int64]*operate.Card, aids, tids []int64) {
  9. if len(ids) == 0 {
  10. return
  11. }
  12. cardm = make(map[int64]*operate.Card, len(ids))
  13. for _, id := range ids {
  14. if o, ok := s.followCache[id]; ok {
  15. card := &operate.Card{}
  16. card.FromFollow(o)
  17. cardm[id] = card
  18. switch card.Goto {
  19. case model.GotoAv:
  20. if card.ID != 0 {
  21. aids = append(aids, card.ID)
  22. }
  23. if card.Tid != 0 {
  24. tids = append(tids, card.Tid)
  25. }
  26. }
  27. }
  28. }
  29. return
  30. }