rpc.go 827 B

123456789101112131415161718192021222324252627282930313233
  1. package account
  2. import (
  3. "context"
  4. account "go-common/app/service/main/account/model"
  5. "go-common/library/ecode"
  6. "go-common/library/log"
  7. )
  8. // Profile get profile from rpc
  9. func (d *Dao) Profile(c context.Context, mid int64, ip string) (p *account.Profile, err error) {
  10. arg := &account.ArgMid{
  11. Mid: mid,
  12. }
  13. if p, err = d.acc.Profile3(c, arg); err != nil {
  14. log.Error("d.acc.Profile3 error(%v) | mid(%d) ip(%s) arg(%v)", err, mid, ip, arg)
  15. err = ecode.CreativeAccServiceErr
  16. }
  17. return
  18. }
  19. //Infos get up infos
  20. func (d *Dao) Infos(c context.Context, mids []int64, ip string) (infos map[int64]*account.Info, err error) {
  21. arg := &account.ArgMids{
  22. Mids: mids,
  23. }
  24. if infos, err = d.acc.Infos3(c, arg); err != nil {
  25. log.Error("d.acc.info3 error(%v) arg(%v)", err, arg)
  26. err = ecode.CreativeAccServiceErr
  27. }
  28. return
  29. }