novicewelfare.pb.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package proto
  2. import (
  3. "bet24.com/log"
  4. "bet24.com/servers/micros/common"
  5. task "bet24.com/servers/micros/task/proto"
  6. "context"
  7. )
  8. func GetSysNoviceWelfare() NoviceWelfare {
  9. xclient := getClient()
  10. //defer xclient.Close()
  11. args := &Request{}
  12. reply := &Response{}
  13. err := xclient.Call(context.Background(), "GetSysNoviceWelfare", args, reply)
  14. if err != nil {
  15. common.GetClientPool().RemoveClient(ServiceName)
  16. log.Debug("activityservice failed to call: %v", err)
  17. }
  18. return reply.SysData
  19. }
  20. func GetUserNoviceWelfare(userId int) UserNoviceWelfare {
  21. xclient := getClient()
  22. //defer xclient.Close()
  23. args := &Request{
  24. UserId: userId,
  25. }
  26. reply := &Response{}
  27. err := xclient.Call(context.Background(), "GetUserNoviceWelfare", args, reply)
  28. if err != nil {
  29. common.GetClientPool().RemoveClient(ServiceName)
  30. log.Debug("activityservice failed to call: %v", err)
  31. }
  32. return reply.UserWelfare
  33. }
  34. func ClaimNoviceWelfareAward(userId, dayIndex int, isFinalPackage bool) bool {
  35. xclient := getClient()
  36. //defer xclient.Close()
  37. args := &Request{
  38. UserId: userId,
  39. DayIndex: dayIndex,
  40. IsFinalPackage: isFinalPackage,
  41. }
  42. reply := &Response{}
  43. err := xclient.Call(context.Background(), "ClaimNoviceWelfareAward", args, reply)
  44. if err != nil {
  45. common.GetClientPool().RemoveClient(ServiceName)
  46. log.Debug("activityservice failed to call: %v", err)
  47. }
  48. return reply.Success
  49. }
  50. func IsNoviceWelfareTip(userId int) bool {
  51. xclient := getClient()
  52. //defer xclient.Close()
  53. args := &Request{
  54. UserId: userId,
  55. }
  56. reply := &Response{}
  57. err := xclient.Call(context.Background(), "IsNoviceWelfareTip", args, reply)
  58. if err != nil {
  59. common.GetClientPool().RemoveClient(ServiceName)
  60. log.Debug("activityservice failed to call: %v", err)
  61. }
  62. return reply.Success
  63. }
  64. func DoAction(userId, action, progress int, param task.TaskScope) {
  65. xclient := getClient()
  66. //defer xclient.Close()
  67. args := &Request{
  68. UserId: userId,
  69. Action: action,
  70. Progress: progress,
  71. Param: param,
  72. }
  73. err := xclient.Call(context.Background(), "DoAction", args, nil)
  74. if err != nil {
  75. common.GetClientPool().RemoveClient(ServiceName)
  76. log.Debug("activityservice failed to call: %v", err)
  77. }
  78. return
  79. }