feat: statistics: finish dev
This commit is contained in:
@@ -2,7 +2,6 @@ package router
|
||||
|
||||
import (
|
||||
"nCovTrack-Backend/global"
|
||||
"nCovTrack-Backend/service/statistics"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -10,14 +9,17 @@ import (
|
||||
)
|
||||
|
||||
func BusiRouter() {
|
||||
userRouter := global.RootRouter.Group("/user")
|
||||
testRouter := global.RootRouter.Group("/test")
|
||||
{
|
||||
userRouter.GET("/count", func(c *gin.Context) {
|
||||
testRouter.GET("/count", func(c *gin.Context) {
|
||||
time.Sleep(800 * time.Millisecond)
|
||||
c.String(http.StatusOK, "OK")
|
||||
})
|
||||
userRouter.GET("/test", func(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, statistics.GetChinaNCovStatistic())
|
||||
})
|
||||
//testRouter.GET("/test", statistics.GetChinaNCovStatistic())
|
||||
//testRouter.GET("/redis", func(c *gin.Context) {
|
||||
// data := statistics.GetAllProvienceData(statistics.SORT_NOW_CONFIRM)
|
||||
// Succ(c, data)
|
||||
//})
|
||||
}
|
||||
statisticRouter()
|
||||
}
|
||||
|
||||
17
router/statistics.go
Normal file
17
router/statistics.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"nCovTrack-Backend/global"
|
||||
"nCovTrack-Backend/handler"
|
||||
)
|
||||
|
||||
func statisticRouter() {
|
||||
statisticsRouter := global.RootRouter.Group("/statistics")
|
||||
{
|
||||
statisticsRouter.GET("/provience/:sort", handler.ProvienceDataHandler)
|
||||
statisticsRouter.GET("/city/:sort", handler.CityDataHandler)
|
||||
statisticsRouter.GET("/country/child", handler.CountryDataHandler)
|
||||
statisticsRouter.GET("/country", handler.CountryDataHandler)
|
||||
statisticsRouter.GET("/china", handler.ChinaDataHandler)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user