member.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package gorpc
  2. import (
  3. "go-common/app/service/main/member/model"
  4. "go-common/library/net/rpc/context"
  5. )
  6. // Base get user base info.
  7. func (r *RPC) Base(c context.Context, arg *model.ArgMemberMid, res *model.BaseInfo) (err error) {
  8. var v *model.BaseInfo
  9. if v, err = r.s.BaseInfo(c, arg.Mid); err == nil && res != nil {
  10. *res = *v
  11. }
  12. return
  13. }
  14. // Bases get batch user base info.
  15. func (r *RPC) Bases(c context.Context, arg *model.ArgMemberMids, res *map[int64]*model.BaseInfo) (err error) {
  16. *res, err = r.s.BatchBaseInfo(c, arg.Mids)
  17. return
  18. }
  19. // Member get member info.
  20. func (r *RPC) Member(c context.Context, arg *model.ArgMemberMid, res *model.Member) (err error) {
  21. var v *model.Member
  22. if v, err = r.s.Member(c, arg.Mid); err == nil && res != nil {
  23. *res = *v
  24. }
  25. return
  26. }
  27. // Members get batch member info.
  28. func (r *RPC) Members(c context.Context, arg *model.ArgMemberMids, res *map[int64]*model.Member) (err error) {
  29. *res, err = r.s.Members(c, arg.Mids)
  30. return
  31. }
  32. // NickUpdated get nickUpdated.
  33. func (r *RPC) NickUpdated(c context.Context, arg *model.ArgMemberMid, res *bool) (err error) {
  34. *res, err = r.s.NickUpdated(c, arg.Mid)
  35. return
  36. }
  37. // SetNickUpdated set nickUpdated.
  38. func (r *RPC) SetNickUpdated(c context.Context, arg *model.ArgMemberMid, res *struct{}) (err error) {
  39. err = r.s.SetNickUpdated(c, arg.Mid)
  40. return
  41. }
  42. // SetOfficialDoc set official doc.
  43. func (r *RPC) SetOfficialDoc(c context.Context, arg *model.ArgOfficialDoc, res *struct{}) (err error) {
  44. err = r.s.SetOfficialDoc(c, arg)
  45. return
  46. }
  47. // SetSex set sex.
  48. func (r *RPC) SetSex(c context.Context, arg *model.ArgUpdateSex, res *struct{}) (err error) {
  49. err = r.s.SetSex(c, arg.Mid, arg.Sex)
  50. return
  51. }
  52. // SetName set name.
  53. func (r *RPC) SetName(c context.Context, arg *model.ArgUpdateUname, res *struct{}) (err error) {
  54. err = r.s.SetName(c, arg.Mid, arg.Name)
  55. return
  56. }
  57. // SetFace set face.
  58. func (r *RPC) SetFace(c context.Context, arg *model.ArgUpdateFace, res *struct{}) (err error) {
  59. err = r.s.SetFace(c, arg.Mid, arg.Face)
  60. return
  61. }
  62. // SetRank set rank.
  63. func (r *RPC) SetRank(c context.Context, arg *model.ArgUpdateRank, res *struct{}) (err error) {
  64. err = r.s.SetRank(c, arg.Mid, arg.Rank)
  65. return
  66. }
  67. // SetBirthday set birthday.
  68. func (r *RPC) SetBirthday(c context.Context, arg *model.ArgUpdateBirthday, res *struct{}) (err error) {
  69. err = r.s.SetBirthday(c, arg.Mid, arg.Birthday)
  70. return
  71. }
  72. // SetSign set sign.
  73. func (r *RPC) SetSign(c context.Context, arg *model.ArgUpdateSign, res *struct{}) (err error) {
  74. err = r.s.SetSign(c, arg.Mid, arg.Sign)
  75. return
  76. }
  77. // OfficialDoc is.
  78. func (r *RPC) OfficialDoc(c context.Context, arg *model.ArgMid, res *model.OfficialDoc) (err error) {
  79. var od *model.OfficialDoc
  80. if od, err = r.s.OfficialDoc(c, arg.Mid); err == nil && od != nil {
  81. *res = *od
  82. }
  83. return
  84. }