banner.go 822 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package v1
  2. import (
  3. "context"
  4. "go-common/app/interface/live/app-blink/conf"
  5. rspb "go-common/app/service/live/resource/api/grpc/v1"
  6. )
  7. // BannerService struct
  8. type BannerService struct {
  9. conf *conf.Config
  10. // optionally add other properties here, such as dao
  11. // dao *dao.Dao
  12. rsCli *rspb.Client
  13. }
  14. //NewBannerService init
  15. func NewBannerService(c *conf.Config) (s *BannerService) {
  16. s = &BannerService{
  17. conf: c,
  18. }
  19. var svc *rspb.Client
  20. var err error
  21. if svc, err = rspb.NewClient(s.conf.ResourceClient); err != nil {
  22. panic(err)
  23. }
  24. s.rsCli = svc
  25. return s
  26. }
  27. // GetBlinkBanner implementation
  28. // 获取banner配置
  29. // `dynamic:"true"`
  30. func (s *BannerService) GetBlinkBanner(ctx context.Context, req *rspb.GetInfoReq) (resp *rspb.GetInfoResp, err error) {
  31. resp, err = s.rsCli.GetBlinkBanner(ctx, req)
  32. return
  33. }