trans_getCasinoRoom.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package transaction
  2. import (
  3. "bet24.com/database"
  4. "bet24.com/log"
  5. "runtime/debug"
  6. )
  7. type trans_getCasinoRoom_out struct {
  8. Room string
  9. GameID int
  10. }
  11. type trans_getCasinoRoom struct {
  12. database.Trans_base
  13. Out trans_getCasinoRoom_out
  14. UserID int
  15. }
  16. func NewTransGetCasinoRoom() *trans_getCasinoRoom {
  17. obj := new(trans_getCasinoRoom)
  18. return obj
  19. }
  20. func (this *trans_getCasinoRoom) DoAction(ch chan<- interface{}) {
  21. defer func() {
  22. if err := recover(); err != nil {
  23. log.Release("transaction recover %v", err)
  24. log.Release("%s", debug.Stack())
  25. }
  26. if ch != nil {
  27. ch <- this
  28. }
  29. }()
  30. statement := database.NewStatement()
  31. statement.SetNeedReturnValue(false)
  32. statement.SetOpenRecordSet(true)
  33. statement.SetProcName("WS_CasinoOnline_GetInfo")
  34. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.UserID)
  35. sqlstring := statement.GenSql()
  36. //log.Debug(sqlstring)
  37. retRows := CenterDB.ExecSql(sqlstring)
  38. if len(retRows) <= 0 {
  39. this.State = false
  40. return
  41. }
  42. // 这里带输出和结果集,最后一行是输出参数
  43. rowCount := len(retRows)
  44. if rowCount > 0 {
  45. ret := retRows[0]
  46. this.Out.GameID = int((ret[0]).(int64))
  47. this.Out.Room = (ret[1]).(string)
  48. }
  49. this.State = true
  50. }