user.go 668 B

123456789101112131415161718192021222324252627
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/service/live/user/api/liverpc/v3"
  5. "go-common/library/log"
  6. )
  7. //GetUserInfo 获取用户信息
  8. func (d *Dao) GetUserInfo(c context.Context, uid []int64) (res map[int64]*v3.UserGetMultipleResp_UserInfo, err error) {
  9. reply, err := d.UserApi.V3User.GetMultiple(c, &v3.UserGetMultipleReq{
  10. Uids: uid,
  11. Attributes: []string{"exp", "info"},
  12. })
  13. if err != nil {
  14. log.Error("%v", err)
  15. return
  16. }
  17. if reply.Code != 0 {
  18. log.Error("user_getUserInfo_error:%d,%s,%v", reply.Code, reply.Msg, reply.Data)
  19. return
  20. }
  21. log.Info("user_getUserInfo:%d,%s,%v", reply.Code, reply.Msg, reply.Data)
  22. res = reply.Data
  23. return
  24. }