user_video.go 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package gatesink
  2. import (
  3. "bet24.com/log"
  4. "bet24.com/servers/coreservice/client"
  5. "bet24.com/servers/fishhall/protocol"
  6. game "bet24.com/servers/micros/game/proto"
  7. "encoding/json"
  8. "fmt"
  9. )
  10. func (this *user) getGameSettleVideoList(msg, data string) {
  11. list := client.GetGameSettleVideoList(this.getUserId())
  12. for _, v := range list {
  13. if info := game.GetGame(v.GameID); info != nil {
  14. v.ChineseName = info.ChineseName
  15. }
  16. }
  17. buf, _ := json.Marshal(list)
  18. this.WriteMsg(msg, string(buf))
  19. return
  20. }
  21. func (this *user) awardGameSettleVideo(msg, data string) {
  22. retData := ""
  23. var req protocol.AwardGameSettleVideo_req
  24. if err := json.Unmarshal([]byte(data), &req); err != nil {
  25. retData = fmt.Sprintf("user.awardGameSettleVideo unmarshal data fail %v", err)
  26. log.Error(retData)
  27. this.WriteMsg(msg, retData)
  28. return
  29. }
  30. resp := client.AwardGameSettleVideo(this.getUserId(), req.SettleId)
  31. if resp.RetCode != 1 {
  32. log.Debug("user.awardGameSettleVideo failed %v", resp)
  33. }
  34. this.WriteMsg(msg, resp.Data)
  35. return
  36. }