playlist.go 630 B

123456789101112131415161718192021222324252627282930313233343536
  1. package client
  2. import (
  3. "context"
  4. "go-common/app/interface/main/playlist/model"
  5. "go-common/library/net/rpc"
  6. )
  7. const (
  8. _setStat = "RPC.SetStat"
  9. _appid = "community.service.playlist"
  10. )
  11. var (
  12. _noReply = &struct{}{}
  13. )
  14. // Service struct info.
  15. type Service struct {
  16. client *rpc.Client2
  17. }
  18. // New new servcie instance and return.
  19. func New(c *rpc.ClientConfig) (s *Service) {
  20. s = &Service{}
  21. s.client = rpc.NewDiscoveryCli(_appid, c)
  22. return
  23. }
  24. // SetStat updates playlist stat cache.
  25. func (s *Service) SetStat(c context.Context, arg *model.ArgStats) (err error) {
  26. err = s.client.Call(c, _setStat, arg, _noReply)
  27. return
  28. }