广告平台(媒体使用)
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

hdl_data_center.go 4.6 KiB

há 3 meses
há 3 meses
há 3 meses
há 3 meses
há 3 meses
há 3 meses
há 3 meses
há 3 meses
há 3 meses
há 3 meses
há 3 meses
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. package hdl
  2. import (
  3. "applet/app/e"
  4. "applet/app/lib/validate"
  5. "applet/app/md"
  6. "applet/app/svc"
  7. "github.com/gin-gonic/gin"
  8. )
  9. // DataCenterTable
  10. // @Summary 数据图表
  11. // @Tags 数据中心------嘉俊
  12. // @Description 数据中心-数据图表
  13. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  14. // @Accept json
  15. // @Produce json
  16. // @Param args body md.DataCenterTableReq true "请求参数"
  17. // @Success 200 {object} md.DataCenterTableRes "具体看返回内容 这是data里面的数据"
  18. // @Failure 400 {object} md.Response "具体错误"
  19. // @Router /api/dataCenter/table [POST]
  20. func DataCenterTable(c *gin.Context) {
  21. var req md.DataCenterTableReq
  22. err := c.ShouldBindJSON(&req)
  23. if err != nil {
  24. err = validate.HandleValidateErr(err)
  25. err1 := err.(e.E)
  26. e.OutErr(c, err1.Code, err1.Error())
  27. return
  28. }
  29. if req.StartDate == "" || req.EndDate == "" {
  30. e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空"))
  31. return
  32. }
  33. res := svc.DataCenterTable(c, req)
  34. e.OutSuc(c, res, nil)
  35. return
  36. }
  37. // DataCenterRecordTotal
  38. // @Summary 数据明细合计
  39. // @Tags 数据中心------嘉俊
  40. // @Description 数据中心-数据明细合计
  41. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  42. // @Accept json
  43. // @Produce json
  44. // @Param args body md.DataCenterTableReq true "请求参数"
  45. // @Success 200 {object} md.DataCenterTotalData "具体看返回内容 这是data里面的数据"
  46. // @Failure 400 {object} md.Response "具体错误"
  47. // @Router /api/dataCenter/record/total [POST]
  48. func DataCenterRecordTotal(c *gin.Context) {
  49. var req md.DataCenterTableReq
  50. err := c.ShouldBindJSON(&req)
  51. if err != nil {
  52. err = validate.HandleValidateErr(err)
  53. err1 := err.(e.E)
  54. e.OutErr(c, err1.Code, err1.Error())
  55. return
  56. }
  57. if req.StartDate == "" || req.EndDate == "" {
  58. e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空"))
  59. return
  60. }
  61. res := svc.DataCenterRecordTotal(c, req)
  62. e.OutSuc(c, res, nil)
  63. return
  64. }
  65. // DataCenterRecordList
  66. // @Summary 数据明细
  67. // @Tags 数据中心------嘉俊
  68. // @Description 数据中心-数据明细
  69. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  70. // @Accept json
  71. // @Produce json
  72. // @Param args body md.DataCenterRecordReq true "请求参数"
  73. // @Success 200 {object} md.DataCenterRecordRes "具体看返回内容 这是data里面的数据"
  74. // @Failure 400 {object} md.Response "具体错误"
  75. // @Router /api/dataCenter/record/list [POST]
  76. func DataCenterRecordList(c *gin.Context) {
  77. var req md.DataCenterRecordReq
  78. err := c.ShouldBindJSON(&req)
  79. if err != nil {
  80. err = validate.HandleValidateErr(err)
  81. err1 := err.(e.E)
  82. e.OutErr(c, err1.Code, err1.Error())
  83. return
  84. }
  85. if req.StartDate == "" || req.EndDate == "" {
  86. e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空"))
  87. return
  88. }
  89. res := svc.DataCenterRecordList(c, req)
  90. e.OutSuc(c, res, nil)
  91. return
  92. }
  93. // DataCenterRecordOutPut
  94. // @Summary 数据明细-导出
  95. // @Tags 数据中心------嘉俊
  96. // @Description 数据中心-数据明细-导出
  97. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  98. // @Accept json
  99. // @Produce json
  100. // @Param args body md.DataCenterRecordOutPutReq true "请求参数"
  101. // @Success 200 {string} "具体看返回内容 这是data里面的数据"
  102. // @Failure 400 {object} md.Response "具体错误"
  103. // @Router /api/dataCenter/record/output [POST]
  104. func DataCenterRecordOutPut(c *gin.Context) {
  105. var req md.DataCenterRecordOutPutReq
  106. err := c.ShouldBindJSON(&req)
  107. if err != nil {
  108. err = validate.HandleValidateErr(err)
  109. err1 := err.(e.E)
  110. e.OutErr(c, err1.Code, err1.Error())
  111. return
  112. }
  113. if req.StartDate == "" || req.EndDate == "" {
  114. e.OutErr(c, 400, e.NewErr(400, "筛选时间不能为空"))
  115. return
  116. }
  117. svc.DataCenterRecordOutPut(c, req)
  118. return
  119. }
  120. // DataCenterSelectData
  121. // @Summary 筛选条件
  122. // @Tags 数据中心------嘉俊
  123. // @Description 数据中心-筛选条件
  124. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  125. // @Accept json
  126. // @Produce json
  127. // @Success 200 {string} "具体看返回内容 这是data里面的数据"
  128. // @Failure 400 {object} md.Response "具体错误"
  129. // @Router /api/dataCenter/select/data [GET]
  130. func DataCenterSelectData(c *gin.Context) {
  131. svc.DataCenterSelectData(c)
  132. }