main.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package novicewelfare
  2. import (
  3. "bet24.com/log"
  4. pb "bet24.com/servers/micros/activityservice/proto"
  5. task "bet24.com/servers/micros/task/proto"
  6. )
  7. func Run() {
  8. getManager()
  9. }
  10. func OnUserEnter(userId int) {
  11. getManager().onUserEnter(userId)
  12. }
  13. func OnUserExit(userId int) {
  14. getManager().onUserExit(userId)
  15. }
  16. func Dump(cmd, param1 string) {
  17. switch cmd {
  18. case "sys":
  19. getManager().dumpSys()
  20. case "user":
  21. getManager().dumpUser(param1)
  22. default:
  23. log.Release("novicewelfare.Dump unhandled cmd %s", cmd)
  24. }
  25. }
  26. func GetSysNoviceWelfare() pb.NoviceWelfare {
  27. return getManager().getSysNoviceWelfare()
  28. }
  29. func GetUserNoviceWelfare(userId int) pb.UserNoviceWelfare {
  30. return getManager().getUserNoviceWelfare(userId)
  31. }
  32. func ClaimNoviceWelfareAward(userId int, dayIndex int, isFinalPackage bool) bool {
  33. return getManager().claimNoviceWelfareAward(userId, dayIndex, isFinalPackage)
  34. }
  35. func IsNoviceWelfareTip(userId int) bool {
  36. return getManager().isNoviceWelfareTip(userId)
  37. }
  38. func DoAction(userId, action, progress int, param task.TaskScope) {
  39. getManager().doAction(userId, action, progress, param)
  40. }