user_track.go 705 B

123456789101112131415161718192021222324252627282930
  1. package gatesink
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "bet24.com/log"
  6. "bet24.com/servers/coreservice/client"
  7. "bet24.com/servers/fishhall/protocol"
  8. )
  9. func (this *user) trackRecord(msg, data string) {
  10. var req protocol.TrackRecord_req
  11. if err := json.Unmarshal([]byte(data), &req); err != nil {
  12. retData := fmt.Sprintf("trackRecord unmarshal data failed %v", data)
  13. log.Error(retData)
  14. this.WriteMsg(msg, retData)
  15. return
  16. }
  17. userId := this.getUserId()
  18. if userId == 0 {
  19. req.Level_2 = req.Level_2 + this.GetIP()
  20. }
  21. resp := client.TrackRecord(userId, req.Level_1, req.Level_2, req.Level_3)
  22. if resp.RetCode != 1 {
  23. log.Debug("user.trackRecord failed %v", resp)
  24. }
  25. this.WriteMsg(msg, resp.Data)
  26. }