activity.go 469 B

1234567891011121314151617181920
  1. package service
  2. import (
  3. "context"
  4. "time"
  5. "go-common/app/interface/openplatform/article/model"
  6. )
  7. // ActInfo .
  8. func (s *Service) ActInfo(c context.Context, plat int8) (res *model.ActInfo, err error) {
  9. res = &model.ActInfo{Activities: []*model.Activity{}, Banners: []*model.Banner{}}
  10. if bs, _ := s.actBanners(c, plat, time.Now()); len(bs) > 0 {
  11. res.Banners = bs
  12. }
  13. for _, act := range s.activities {
  14. res.Activities = append(res.Activities, act)
  15. }
  16. return
  17. }