go-common/app/interface/openplatform/article/service/activity.go

21 lines
469 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
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
}