medal.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package client
  2. import (
  3. "context"
  4. "go-common/app/service/main/usersuit/model"
  5. )
  6. const (
  7. _medalHomeInfo = "RPC.MedalHomeInfo"
  8. _medalUserInfo = "RPC.MedalUserInfo"
  9. _medalInstall = "RPC.MedalInstall"
  10. _medalPopup = "RPC.MedalPopup"
  11. _medalMyInfo = "RPC.MedalMyInfo"
  12. _medalAllInfo = "RPC.MedalAllInfo"
  13. _medalGrant = "RPC.MedalGrant"
  14. _medalActivated = "RPC.MedalActivated"
  15. _medalActivatedMulti = "RPC.MedalActivatedMulti"
  16. )
  17. // MedalHomeInfo return user mdeal home info.
  18. func (s *Service2) MedalHomeInfo(c context.Context, arg *model.ArgMid) (res []*model.MedalHomeInfo, err error) {
  19. err = s.client.Call(c, _medalHomeInfo, arg, &res)
  20. return
  21. }
  22. // MedalUserInfo return medal user info.
  23. func (s *Service2) MedalUserInfo(c context.Context, arg *model.ArgMedalUserInfo) (res *model.MedalUserInfo, err error) {
  24. res = new(model.MedalUserInfo)
  25. err = s.client.Call(c, _medalUserInfo, arg, res)
  26. return
  27. }
  28. // MedalInstall install or uninstall medal.
  29. func (s *Service2) MedalInstall(c context.Context, arg *model.ArgMedalInstall) (err error) {
  30. err = s.client.Call(c, _medalInstall, arg, _noRes)
  31. return
  32. }
  33. // MedalPopup return medal popup.
  34. func (s *Service2) MedalPopup(c context.Context, arg *model.ArgMid) (res *model.MedalPopup, err error) {
  35. res = new(model.MedalPopup)
  36. err = s.client.Call(c, _medalPopup, arg, res)
  37. return
  38. }
  39. // MedalMyInfo return medal my info.
  40. func (s *Service2) MedalMyInfo(c context.Context, arg *model.ArgMid) (res []*model.MedalMyInfos, err error) {
  41. err = s.client.Call(c, _medalMyInfo, arg, &res)
  42. return
  43. }
  44. // MedalAllInfo return medal all info.
  45. func (s *Service2) MedalAllInfo(c context.Context, arg *model.ArgMid) (res *model.MedalAllInfos, err error) {
  46. err = s.client.Call(c, _medalAllInfo, arg, &res)
  47. return
  48. }
  49. // MedalGrant send a medal to user.
  50. func (s *Service2) MedalGrant(c context.Context, arg *model.ArgMIDNID) (err error) {
  51. err = s.client.Call(c, _medalGrant, arg, _noRes)
  52. return
  53. }
  54. // MedalActivated get the user activated medal info.
  55. func (s *Service2) MedalActivated(c context.Context, arg *model.ArgMid) (res *model.MedalInfo, err error) {
  56. err = s.client.Call(c, _medalActivated, arg, &res)
  57. return
  58. }
  59. // MedalActivatedMulti Multi get the user activated medal info(at most 50).
  60. func (s *Service2) MedalActivatedMulti(c context.Context, arg *model.ArgMids) (res map[int64]*model.MedalInfo, err error) {
  61. err = s.client.Call(c, _medalActivatedMulti, arg, &res)
  62. return
  63. }