splash.go 807 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. // SplashService struct
  8. type SplashService struct {
  9. conf *conf.Config
  10. // optionally add other properties here, such as dao
  11. // dao *dao.Dao
  12. rsCli *rspb.Client
  13. }
  14. //NewSplashService init
  15. func NewSplashService(c *conf.Config) (s *SplashService) {
  16. s = &SplashService{
  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. // GetInfo implementation
  28. // 获取有效闪屏配置
  29. // `dynamic:"true"`
  30. func (s *SplashService) GetInfo(ctx context.Context, req *rspb.GetInfoReq) (resp *rspb.GetInfoResp, err error) {
  31. resp, err = s.rsCli.GetInfo(ctx, req)
  32. return
  33. }