68 lines
1.1 KiB
Go
68 lines
1.1 KiB
Go
package controller
|
|
|
|
import (
|
|
"backend/model"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func StatisticsLevel(c *gin.Context) {
|
|
statistics := model.Statistics{}
|
|
err := c.BindJSON(&statistics)
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
res, err := statistics.StatisticsLevel()
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
success(c, res)
|
|
}
|
|
|
|
func StatisticsOrder(c *gin.Context) {
|
|
statistics := model.Statistics{}
|
|
err := c.BindJSON(&statistics)
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
res, err := statistics.StatisticsOrder()
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
success(c, res)
|
|
}
|
|
|
|
func StatisticsInfo(c *gin.Context) {
|
|
statistics := model.Statistics{}
|
|
err := c.BindJSON(&statistics)
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
res, err := statistics.StatisticsInfo()
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
success(c, res)
|
|
}
|
|
|
|
func StatisticsHeat(c *gin.Context) {
|
|
statistics := model.Statistics{}
|
|
err := c.BindJSON(&statistics)
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
res, err := statistics.StatisticsHeat()
|
|
if err != nil {
|
|
failed(c, err.Error())
|
|
return
|
|
}
|
|
success(c, res)
|
|
}
|