feat: article: finish base functions

This commit is contained in:
fallen-angle
2022-02-15 16:49:32 +08:00
parent 72ef5c92c4
commit be5def58fd
13 changed files with 245 additions and 37 deletions

View File

@@ -8,22 +8,22 @@ import (
"github.com/gin-gonic/gin"
)
// Get provience statistics
// ProvinceDataHandler Get province statistics
// @Tags Statistics
// @Prodeuce json
// @Summary provience statistics
// @Produce json
// @Summary province statistics
// @Success 200 {object} models.GinResponse{data=[]models.AreaInfo}
// @Router /statistics/provience/{sort} [get]
// @Router /statistics/province/{sort} [get]
// @Param sort path string false "data sorted by" Enums(today, total, now, default)
func ProvienceDataHandler(c *gin.Context) {
func ProvinceDataHandler(c *gin.Context) {
sort := c.Param("sort")
data := service.GetAllProvienceData(sort)
utils.Succ(c, data)
}
// Get city statistics
// CityDataHandler Get city statistics
// @Tags Statistics
// @Prodeuce json
// @Produce json
// @Summary city statistics
// @Success 200 {object} models.GinResponse{data=[]models.AreaInfo}
// @Router /statistics/city/{sort} [get]
@@ -34,9 +34,9 @@ func CityDataHandler(c *gin.Context) {
utils.Succ(c, data)
}
// Get country statistics(only china currently)
// CountryDataHandler Get country statistics(only china currently)
// @Tags Statistics
// @Prodeuce json
// @Produce json
// @Summary country statistics
// @Success 200 {object} models.GinResponse{data=[]models.AreaInfo}
// @Router /statistics/country/child [get]
@@ -47,9 +47,9 @@ func CountryDataHandler(c *gin.Context) {
utils.Succ(c, data)
}
// Get china data
// ChinaDataHandler Get china data
// @Tags Statistics
// @Prodeuce json
// @Produce json
// @Summary china data
// @Success 200 {object} models.GinResponse{data=models.ChinaData}
// @Router /statistics/china [get]