go-common/app/interface/openplatform/article/service/activity.go
2019-04-22 18:49:16 +08:00

21 lines
469 B
Go

package service
import (
"context"
"time"
"go-common/app/interface/openplatform/article/model"
)
// ActInfo .
func (s *Service) ActInfo(c context.Context, plat int8) (res *model.ActInfo, err error) {
res = &model.ActInfo{Activities: []*model.Activity{}, Banners: []*model.Banner{}}
if bs, _ := s.actBanners(c, plat, time.Now()); len(bs) > 0 {
res.Banners = bs
}
for _, act := range s.activities {
res.Activities = append(res.Activities, act)
}
return
}