feat: statistics: finish dev

This commit is contained in:
fallen-angle
2022-01-23 18:28:01 +08:00
parent 582807ae10
commit d844711191
29 changed files with 1670 additions and 51 deletions

20
utils/response.go Normal file
View File

@@ -0,0 +1,20 @@
package utils
import (
"nCovTrack-Backend/models"
"net/http"
"github.com/gin-gonic/gin"
)
func Success(c *gin.Context, code int, msg interface{}, data interface{}) {
c.JSON(http.StatusOK, models.GinResponse{Code: code, Msg: msg, Data: data})
}
func Error(c *gin.Context, status int, code int, msg interface{}, data interface{}) {
c.JSON(status, models.GinResponse{Code: code, Msg: msg, Data: data})
}
func Succ(c *gin.Context, data interface{}) {
Success(c, http.StatusOK, "success", data)
}