controllger.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package matchdata
  2. import (
  3. "net/http"
  4. "bet24.com/log"
  5. "github.com/gin-gonic/gin"
  6. )
  7. // 获取赛事列表
  8. func GetMatchList(c *gin.Context) {
  9. obj := NewGetMatchList()
  10. if err := c.ShouldBind(&obj.In); err != nil {
  11. log.Debug("%s shouldBind err %v", "getMatchList", err)
  12. return
  13. }
  14. count, list := mgr.getMatchList(obj.In.PageIndex, obj.In.PageSize,
  15. obj.In.SerialNumber, obj.In.BeginTime, obj.In.EndTime)
  16. obj.Out.RecordCount = count
  17. obj.Out.List = list
  18. c.JSON(http.StatusOK, obj.Out)
  19. return
  20. }
  21. // 获取加入的名单
  22. func GetJoinList(c *gin.Context) {
  23. obj := NewGetJoinList()
  24. if err := c.ShouldBind(&obj.In); err != nil {
  25. log.Debug("%s shouldBind err %v", "getJoinList", err)
  26. return
  27. }
  28. count, list := mgr.getJoinList(obj.In.UserID, obj.In.IsAward, obj.In.PageIndex, obj.In.PageSize,
  29. obj.In.SerialNumber, obj.In.BeginTime, obj.In.EndTime)
  30. obj.Out.RecordCount = count
  31. obj.Out.List = list
  32. c.JSON(http.StatusOK, obj.Out)
  33. return
  34. }
  35. // 根据类型获取名单
  36. func GetTypeList(c *gin.Context) {
  37. obj := NewGetTypeList()
  38. if err := c.ShouldBind(&obj.In); err != nil {
  39. log.Debug("%s shouldBind err %v", "getTypeList", err)
  40. return
  41. }
  42. obj.Out.List = mgr.getTypeList(obj.In.SerialNumber)
  43. c.JSON(http.StatusOK, obj.Out)
  44. return
  45. }
  46. // 获取加入的总费用
  47. func GetJoinTotalFee(c *gin.Context) {
  48. obj := NewGetJoinTotalFee()
  49. if err := c.ShouldBind(&obj.In); err != nil {
  50. log.Debug("%s shouldBind err %v", "getJoinTotalFee", err)
  51. return
  52. }
  53. obj.Out.List = mgr.getJoinTotalFee(obj.In.SerialNumber)
  54. c.JSON(http.StatusOK, obj.Out)
  55. return
  56. }