relation.go 848 B

1234567891011121314151617181920212223242526272829303132
  1. package dao
  2. import (
  3. "context"
  4. "github.com/pkg/errors"
  5. "go-common/app/service/live/relation/api/liverpc/v1"
  6. "go-common/library/log"
  7. )
  8. //GetUserFc 获取用户关注数
  9. func (d *Dao) GetUserFc(c context.Context, uid int64) (res *v1.FeedGetUserFcResp_Data, err error) {
  10. reply, err := d.RelationApi.V1Feed.GetUserFc(c, &v1.FeedGetUserFcReq{Follow: uid})
  11. if err != nil {
  12. log.Error("relation_GetUserFc_error:%v", err)
  13. return
  14. }
  15. if reply.Code != 0 {
  16. err = errors.New("code error")
  17. log.Error("relation_gGetUserFc_error:%d,%s,%v", reply.Code, reply.Msg, reply.Data)
  18. return
  19. }
  20. if reply.Data == nil {
  21. err = errors.New("data error")
  22. log.Error("relation_gGetUserFc_error:%d,%s,%v", reply.Code, reply.Msg, reply.Data)
  23. return
  24. }
  25. log.Info("relation_gGetUserFc:%d,%s,$v", reply.Code, reply.Msg, reply.Data)
  26. res = reply.Data
  27. return
  28. }