user_card.go 631 B

123456789101112131415161718192021222324252627
  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) useRechargeCard(msg, data string) {
  10. retData := ""
  11. var req protocol.RechargeCard_req
  12. if err := json.Unmarshal([]byte(data), &req); err != nil {
  13. retData = fmt.Sprintf("user.useRechargeCard Unmarshal data failed %v", err)
  14. log.Error(retData)
  15. this.WriteMsg(msg, retData)
  16. return
  17. }
  18. resp := client.UseRechargeCard(this.getUserId(), req.CardNo)
  19. if resp.RetCode != 1 {
  20. log.Debug("user.useRechargeCard failed %v", resp)
  21. }
  22. this.WriteMsg(msg, resp.Data)
  23. }