cash.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. package controller
  2. import (
  3. "net/http"
  4. "bet24.com/log"
  5. "bet24.com/servers/adminserver/dao"
  6. notification "bet24.com/servers/micros/notification/proto"
  7. "github.com/gin-gonic/gin"
  8. )
  9. // 金币日志
  10. func GetCashLog(c *gin.Context) {
  11. obj := dao.NewGetCashLog()
  12. if err := c.ShouldBind(&obj.In); err != nil {
  13. log.Debug("%s shouldBind err %v", "getCashLog", err)
  14. return
  15. }
  16. obj.DoAction(nil)
  17. c.JSON(http.StatusOK, obj.Out)
  18. return
  19. }
  20. // 钻石日志
  21. func GetDiamondLog(c *gin.Context) {
  22. obj := dao.NewGetDiamondLog()
  23. if err := c.ShouldBind(&obj.In); err != nil {
  24. log.Debug("%s shouldBind err %v", "getDiamondLog", err)
  25. return
  26. }
  27. obj.DoAction(nil)
  28. c.JSON(http.StatusOK, obj.Out)
  29. return
  30. }
  31. // 投注日志
  32. func GetBetLog(c *gin.Context) {
  33. obj := dao.NewGetBetLog()
  34. if err := c.ShouldBind(&obj.In); err != nil {
  35. log.Debug("%s shouldBind err %v", "getBetLog", err)
  36. return
  37. }
  38. obj.DoAction(nil)
  39. c.JSON(http.StatusOK, obj.Out)
  40. return
  41. }
  42. // 投注详情
  43. func GetBetDetail(c *gin.Context) {
  44. obj := dao.NewGetBetDetail()
  45. if err := c.ShouldBind(&obj.In); err != nil {
  46. log.Debug("%s shouldBind err %v", "getBetDetail", err)
  47. return
  48. }
  49. obj.DoAction()
  50. c.JSON(http.StatusOK, obj.Out)
  51. return
  52. }
  53. // 加金
  54. func CashSend(c *gin.Context) {
  55. obj := dao.NewCashSend()
  56. if err := c.ShouldBind(&obj.In); err != nil {
  57. log.Debug("%s shouldBind err %v", "cashSend", err)
  58. return
  59. }
  60. obj.DoAction(nil)
  61. c.JSON(http.StatusOK, obj.Out)
  62. return
  63. }
  64. // 扣金
  65. func CashDel(c *gin.Context) {
  66. obj := dao.NewCashDel()
  67. if err := c.ShouldBind(&obj.In); err != nil {
  68. log.Debug("%s shouldBind err %v", "cashDel", err)
  69. return
  70. }
  71. obj.DoAction(nil)
  72. // 通知客户端
  73. go notification.AddNotification(obj.In.UserID, notification.Notification_Gold, "")
  74. c.JSON(http.StatusOK, obj.Out)
  75. return
  76. }
  77. // 金币场解锁
  78. func CashUnlock(c *gin.Context) {
  79. obj := dao.NewCashUnlock()
  80. if err := c.ShouldBind(&obj.In); err != nil {
  81. log.Debug("%s shouldBind err %v", "cashUnlock", err)
  82. return
  83. }
  84. obj.DoAction(nil)
  85. c.JSON(http.StatusOK, obj.Out)
  86. return
  87. }
  88. // 金币锁信息
  89. func CashLockInfo(c *gin.Context) {
  90. obj := dao.NewCashLockInfo()
  91. if err := c.ShouldBind(&obj.In); err != nil {
  92. log.Debug("%s shouldBind err %v", "cashLockInfo", err)
  93. return
  94. }
  95. obj.DoAction(nil)
  96. c.JSON(http.StatusOK, obj.Out)
  97. return
  98. }
  99. // 货币统计
  100. func MoneyStat(c *gin.Context) {
  101. obj := dao.NewMoneyStat()
  102. if err := c.ShouldBind(&obj.In); err != nil {
  103. log.Debug("%s shouldBind err %v", "moneyStat", err)
  104. return
  105. }
  106. obj.DoAction(nil)
  107. c.JSON(http.StatusOK, obj.Out)
  108. return
  109. }
  110. // 后台扣减钻石
  111. func DiamondWebReduce(c *gin.Context) {
  112. obj := dao.NewDiamondWebReduce()
  113. if err := c.ShouldBind(&obj.In); err != nil {
  114. log.Debug("%s shouldBind err %v", "diamondWebReduce", err)
  115. return
  116. }
  117. obj.DoAction()
  118. c.JSON(http.StatusOK, obj.Out)
  119. return
  120. }
  121. // 后台钻石日志
  122. func GetDiamondAdminLog(c *gin.Context) {
  123. obj := dao.NewGetDiamondAdminLog()
  124. if err := c.ShouldBind(&obj.In); err != nil {
  125. log.Debug("%s shouldBind err %v", "getDiamondAdminLog", err)
  126. return
  127. }
  128. obj.DoAction(nil)
  129. c.JSON(http.StatusOK, obj.Out)
  130. return
  131. }
  132. // 游戏金币流量统计
  133. func MoneyFlowStat(c *gin.Context) {
  134. obj := dao.NewMoneyFlowStat()
  135. if err := c.ShouldBind(&obj.In); err != nil {
  136. log.Debug("%s shouldBind err %v", "MoneyFlowStat", err)
  137. return
  138. }
  139. obj.DoAction(nil)
  140. c.JSON(http.StatusOK, obj.Out)
  141. return
  142. }
  143. // 赠送日志
  144. func CashTransferLog(c *gin.Context) {
  145. obj := dao.NewTransferLog()
  146. if err := c.ShouldBind(&obj.In); err != nil {
  147. log.Debug("%s shouldBind err %v", "ChipTransferLog", err)
  148. return
  149. }
  150. obj.GetCashTransferLog()
  151. c.JSON(http.StatusOK, obj.Out)
  152. return
  153. }