member.go 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. package gorpc
  2. import (
  3. "context"
  4. "go-common/app/service/main/member/model"
  5. )
  6. const (
  7. _Base = "RPC.Base"
  8. _Bases = "RPC.Bases"
  9. _Member = "RPC.Member"
  10. _Members = "RPC.Members"
  11. _UpdateExp = "RPC.UpdateExp"
  12. _Exp = "RPC.Exp"
  13. _Level = "RPC.Level"
  14. _Log = "RPC.Log"
  15. _Stat = "RPC.Stat"
  16. _NickUpdated = "RPC.NickUpdated"
  17. _SetNickUpdated = "RPC.SetNickUpdated"
  18. _Moral = "RPC.Moral"
  19. _MoralLog = "RPC.MoralLog"
  20. _SetOfficialDoc = "RPC.SetOfficialDoc"
  21. _OfficialDoc = "RPC.OfficialDoc"
  22. _setName = "RPC.SetName"
  23. _setSign = "RPC.SetSign"
  24. _setRank = "RPC.SetRank"
  25. _setFace = "RPC.SetFace"
  26. _setSex = "RPC.SetSex"
  27. _setBirthday = "RPC.SetBirthday"
  28. _addMoral = "RPC.AddMoral"
  29. _batchAddMoral = "RPC.BatchAddMoral"
  30. )
  31. // Exp rpc user exp.
  32. func (s *Service) Exp(c context.Context, arg *model.ArgMid2) (res *model.LevelInfo, err error) {
  33. res = new(model.LevelInfo)
  34. err = s.client.Call(c, _Exp, arg, res)
  35. return
  36. }
  37. // Level user level.
  38. func (s *Service) Level(c context.Context, arg *model.ArgMid2) (res *model.LevelInfo, err error) {
  39. res = new(model.LevelInfo)
  40. err = s.client.Call(c, _Level, arg, res)
  41. return
  42. }
  43. // Log user exp log.
  44. func (s *Service) Log(c context.Context, arg *model.ArgMid2) (res []*model.UserLog, err error) {
  45. err = s.client.Call(c, _Log, arg, &res)
  46. return
  47. }
  48. // Stat user exp log.
  49. func (s *Service) Stat(c context.Context, arg *model.ArgMid2) (res *model.ExpStat, err error) {
  50. err = s.client.Call(c, _Stat, arg, &res)
  51. return
  52. }
  53. // UpdateExp update user exp.
  54. func (s *Service) UpdateExp(c context.Context, arg *model.ArgAddExp) (err error) {
  55. err = s.client.Call(c, _UpdateExp, arg, &_noRes)
  56. return
  57. }
  58. // Base get user base info.
  59. func (s *Service) Base(c context.Context, arg *model.ArgMemberMid) (res *model.BaseInfo, err error) {
  60. err = s.client.Call(c, _Base, arg, &res)
  61. return
  62. }
  63. // Bases get batch base info.
  64. func (s *Service) Bases(c context.Context, arg *model.ArgMemberMids) (res map[int64]*model.BaseInfo, err error) {
  65. err = s.client.Call(c, _Bases, arg, &res)
  66. return
  67. }
  68. // Member get the full information within member-service.
  69. func (s *Service) Member(c context.Context, arg *model.ArgMemberMid) (res *model.Member, err error) {
  70. err = s.client.Call(c, _Member, arg, &res)
  71. return
  72. }
  73. // Members get batch the full information within member-service.
  74. func (s *Service) Members(c context.Context, arg *model.ArgMemberMids) (res map[int64]*model.Member, err error) {
  75. err = s.client.Call(c, _Members, arg, &res)
  76. return
  77. }
  78. // NickUpdated get nickUpdated.
  79. func (s *Service) NickUpdated(c context.Context, arg *model.ArgMemberMid) (res bool, err error) {
  80. err = s.client.Call(c, _NickUpdated, arg, &res)
  81. return
  82. }
  83. // SetNickUpdated set nickUpdated.
  84. func (s *Service) SetNickUpdated(c context.Context, arg *model.ArgMemberMid) (err error) {
  85. err = s.client.Call(c, _SetNickUpdated, arg, &_noRes)
  86. return
  87. }
  88. // SetOfficialDoc set official doc.
  89. func (s *Service) SetOfficialDoc(c context.Context, arg *model.ArgOfficialDoc) (err error) {
  90. err = s.client.Call(c, _SetOfficialDoc, arg, &_noRes)
  91. return
  92. }
  93. // SetName set name.
  94. func (s *Service) SetName(c context.Context, arg *model.ArgUpdateUname) (err error) {
  95. err = s.client.Call(c, _setName, arg, &_noRes)
  96. return
  97. }
  98. // SetSign set sign.
  99. func (s *Service) SetSign(c context.Context, arg *model.ArgUpdateSign) (err error) {
  100. err = s.client.Call(c, _setSign, arg, &_noRes)
  101. return
  102. }
  103. // SetBirthday set birthday.
  104. func (s *Service) SetBirthday(c context.Context, arg *model.ArgUpdateBirthday) (err error) {
  105. err = s.client.Call(c, _setBirthday, arg, &_noRes)
  106. return
  107. }
  108. // SetFace set face.
  109. func (s *Service) SetFace(c context.Context, arg *model.ArgUpdateFace) (err error) {
  110. err = s.client.Call(c, _setFace, arg, &_noRes)
  111. return
  112. }
  113. // SetSex set sex.
  114. func (s *Service) SetSex(c context.Context, arg *model.ArgUpdateSex) (err error) {
  115. err = s.client.Call(c, _setSex, arg, &_noRes)
  116. return
  117. }
  118. // SetRank set rank.
  119. func (s *Service) SetRank(c context.Context, arg *model.ArgUpdateRank) (err error) {
  120. err = s.client.Call(c, _setRank, arg, &_noRes)
  121. return
  122. }
  123. // OfficialDoc is.
  124. func (s *Service) OfficialDoc(c context.Context, arg *model.ArgMid) (res *model.OfficialDoc, err error) {
  125. res = new(model.OfficialDoc)
  126. err = s.client.Call(c, _OfficialDoc, arg, res)
  127. return
  128. }