push.go 913 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package dao
  2. import (
  3. "context"
  4. "fmt"
  5. notice "go-common/app/service/bbq/notice-service/api/v1"
  6. "go-common/library/log"
  7. )
  8. // PushLogin .
  9. func (d *Dao) PushLogin(c context.Context, req *notice.UserPushDev) (err error) {
  10. _, err = d.noticeClient.PushLogin(c, req)
  11. if err != nil {
  12. log.Errorv(c, log.KV("log", fmt.Sprintf("push login fail: req=%s", req.String())))
  13. }
  14. return
  15. }
  16. // PushLogout .
  17. func (d *Dao) PushLogout(c context.Context, req *notice.UserPushDev) (err error) {
  18. _, err = d.noticeClient.PushLogout(c, req)
  19. if err != nil {
  20. log.Errorv(c, log.KV("log", fmt.Sprintf("push logout fail: req=%s", req.String())))
  21. }
  22. return
  23. }
  24. // PushCallback .
  25. func (d *Dao) PushCallback(c context.Context, tid string, nid string, mid int64, buvid string) (err error) {
  26. _, err = d.noticeClient.PushCallback(c, &notice.PushCallbackRequest{
  27. Tid: tid,
  28. Nid: nid,
  29. Mid: mid,
  30. Buvid: buvid,
  31. })
  32. return
  33. }