archive.go 667 B

123456789101112131415161718192021222324252627
  1. package service
  2. import (
  3. "context"
  4. lmdl "go-common/app/admin/main/activity/model"
  5. arcmdl "go-common/app/service/main/archive/api"
  6. "go-common/library/log"
  7. )
  8. // Archives get achives info .
  9. func (s *Service) Archives(c context.Context, p *lmdl.ArchiveParam) (res map[int64]*arcmdl.Arc, err error) {
  10. var (
  11. arcs *arcmdl.ArcsReply
  12. )
  13. if arcs, err = s.arcClient.Arcs(c, &arcmdl.ArcsRequest{Aids: p.Aids}); err != nil {
  14. log.Error("s.arcClient.Archives3(%v) error(%v)", p.Aids, err)
  15. return
  16. }
  17. res = make(map[int64]*arcmdl.Arc, len(p.Aids))
  18. for _, aid := range p.Aids {
  19. if arc, ok := arcs.Arcs[aid]; ok && arc.IsNormal() {
  20. res[aid] = arc
  21. }
  22. }
  23. return
  24. }