data.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package proto
  2. // 竞猜配置
  3. type GuessCfg struct {
  4. BetAmount []int // 投注金额
  5. MailTitle string // 邮件标题
  6. MailSource string // 邮件源
  7. MailContent string // 邮件内容
  8. }
  9. const (
  10. MatchStatus_Invalid = iota // 0=无效状态
  11. MatchStatus_Open // 1=开启状态
  12. MatchStatus_End // 2=结束状态(停止下注)
  13. MatchStatus_Award // 3=已派奖
  14. MatchStatus_Max
  15. )
  16. const (
  17. MatchType_All = iota // 0=所有赛事
  18. MatchType_Show // 1=展示的赛事(不可投注)
  19. MatchType_Bet // 2=正在进行的赛事(可以投注)
  20. MatchType_End // 3=结束的赛事(已出结果)
  21. MatchType_Preheat // 4=预热的赛事
  22. )
  23. // RetMsg 返回消息
  24. type RetMsg struct {
  25. RetCode int
  26. Message string
  27. }
  28. // Match 赛事
  29. type Match struct {
  30. SerialNumber string // 流水号
  31. Title string // 标题(如:让球)
  32. Status int // 状态(0=无效状态 1=开启状态 2=结束状态)
  33. Teams []Team // 球队(主、客队)
  34. Bets []Bet // 投注
  35. Result string // 赛事结果
  36. StartAt int `json:",omitempty"` // 开始时间戳
  37. EndAt int `json:",omitempty"` // 结束时间戳
  38. ShowStartAt int `json:",omitempty"` // 展示开始时间戳
  39. ShowEndAt int `json:",omitempty"` // 展示结束时间戳
  40. }
  41. // Team 球队
  42. type Team struct {
  43. Rid int // 记录ID
  44. Id int // 球队ID
  45. Name string // 球队名称
  46. Icon string // 球队图标
  47. ShortName string `json:",omitempty"` // 球队简称
  48. }
  49. // 操作员
  50. type OpUser struct {
  51. OpUserId int `json:",omitempty"` // 操作员id
  52. OpUserName string `json:",omitempty"` // 操作员名称
  53. IpAddress string `json:",omitempty"` // ip地址
  54. }
  55. // Bet 投注
  56. type Bet struct {
  57. Id int // 投注id
  58. Name string // 投注名称
  59. Odds float64 // 投注赔率
  60. Amount int // 投注金额
  61. IsWin bool // 是否胜
  62. }
  63. // BetRecord 投注记录
  64. type BetRecord struct {
  65. SerialNumber string `json:"-"` // 流水号
  66. BetId int `json:"-"` // 投注id
  67. BetName string // 投注名称
  68. BetAmount int // 投注金额
  69. ResultAmount int // 派奖金额
  70. Title string // 标题(如:让球)
  71. Status int // 状态(0=无效状态 1=开启状态 2=结束状态)
  72. Teams []Team // 球队(主、客队)
  73. Result string // 赛事结果
  74. StartTime int // 开始时间
  75. }
  76. // 下注结算
  77. type BetSettle struct {
  78. Rid int // 标识id
  79. UserId int // 用户ID
  80. BetAmount int // 下注金额
  81. ResultAmount int // 派奖金额
  82. }
  83. // UserBet 用户投注
  84. type UserBet struct {
  85. BetId int // 投注id
  86. BetAmount int // 投注金额
  87. }