controller.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package game
  2. import (
  3. "net/http"
  4. "bet24.com/log"
  5. "github.com/gin-gonic/gin"
  6. )
  7. // 游戏记录报表(局数、时长)
  8. func RecordIndexStat(c *gin.Context) {
  9. var req struct {
  10. GameID int
  11. PartnerID int
  12. BeginTime string
  13. EndTime string
  14. }
  15. if err := c.ShouldBind(&req); err != nil {
  16. log.Debug("%s shouldBind err %v", "game.RecordIndexStat", err)
  17. return
  18. }
  19. list := mgr.recordIndexStat(req.GameID, req.PartnerID, req.BeginTime, req.EndTime)
  20. c.JSON(http.StatusOK, struct {
  21. List interface{}
  22. }{
  23. List: list,
  24. })
  25. return
  26. }
  27. // 获取牌局统计
  28. func GetCardStatList(c *gin.Context) {
  29. var req requestInfo
  30. if err := c.ShouldBind(&req); err != nil {
  31. log.Debug("%s shouldBind err %v", "game.GetCardStatList", err)
  32. return
  33. }
  34. recordCount, list := mgr.getCardStatList(req)
  35. c.JSON(http.StatusOK, struct {
  36. RecordCount int
  37. List interface{}
  38. }{
  39. RecordCount: recordCount,
  40. List: list,
  41. })
  42. return
  43. }
  44. // 中途退出统计
  45. func GetMidwayStatList(c *gin.Context) {
  46. var req requestInfo
  47. if err := c.ShouldBind(&req); err != nil {
  48. log.Debug("%s shouldBind err %v", "game.GetMidwayStatList", err)
  49. return
  50. }
  51. recordCount, list := mgr.getMidwayStatList(req)
  52. c.JSON(http.StatusOK, struct {
  53. RecordCount int
  54. List interface{}
  55. }{
  56. RecordCount: recordCount,
  57. List: list,
  58. })
  59. return
  60. }
  61. // 水池统计
  62. func GetWaterPoolStatList(c *gin.Context) {
  63. var req requestInfo
  64. if err := c.ShouldBind(&req); err != nil {
  65. log.Debug("%s shouldBind err %v", "game.GetWaterPoolStatList", err)
  66. return
  67. }
  68. list := mgr.getWaterPoolStatList(req)
  69. c.JSON(http.StatusOK, struct {
  70. RecordCount int
  71. List interface{}
  72. }{
  73. RecordCount: 0,
  74. List: list,
  75. })
  76. return
  77. }