user_dailywheel.go 916 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package gatesink
  2. import (
  3. "bet24.com/log"
  4. activityservice "bet24.com/servers/micros/activityservice/proto"
  5. )
  6. // 处理新手福利指令
  7. func (this *user) onDailyWheelMsg(msg, data string) {
  8. switch msg {
  9. case "getDailyWheelInfo":
  10. this.getDailyWheelInfo(msg)
  11. case "doDailyWheel": //
  12. this.doDailyWheel(msg)
  13. case "refreshDailyWheelTask": //
  14. this.refreshDailyWheelTask(msg)
  15. default:
  16. log.Release("user.onDailyWheelMsg unhandled msg %s", msg)
  17. }
  18. }
  19. func (this *user) getDailyWheelInfo(msg string) {
  20. this.WriteMsg(msg, activityservice.GetDailyWheelInfo(this.getUserId()))
  21. return
  22. }
  23. func (this *user) doDailyWheel(msg string) {
  24. this.WriteMsg(msg, activityservice.DoDailyWheel(this.getUserId()))
  25. return
  26. }
  27. func (this *user) refreshDailyWheelTask(msg string) {
  28. if activityservice.RefreshDailyWheelTask(this.getUserId()) {
  29. this.WriteMsg(msg, "ok")
  30. } else {
  31. this.WriteMsg(msg, "failed")
  32. }
  33. return
  34. }