From 5e658f2527d572359501fc10abe02425b6e665c4 Mon Sep 17 00:00:00 2001 From: Mrx <18278715334@163.com> Date: Mon, 23 Mar 2026 15:34:27 +0800 Subject: [PATCH] add newapilist --- internal/infrastructure/http/handlers/statistics_handler.go | 6 +++--- internal/infrastructure/http/routes/statistics_routes.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/infrastructure/http/handlers/statistics_handler.go b/internal/infrastructure/http/handlers/statistics_handler.go index f37487c..ede94c5 100644 --- a/internal/infrastructure/http/handlers/statistics_handler.go +++ b/internal/infrastructure/http/handlers/statistics_handler.go @@ -1232,7 +1232,7 @@ func (h *StatisticsHandler) GetRechargeStatistics(c *gin.Context) { // GetLatestProducts 获取最新产品推荐 // @Summary 获取最新产品推荐 // @Description 获取近一月内新增的产品,如果近一月内没有新增则返回最新的前10个产品 -// @Tags 统计 +// @Tags 统计公开接口 // @Accept json // @Produce json // @Param limit query int false "返回数量限制" default(10) @@ -1521,7 +1521,7 @@ func (h *StatisticsHandler) AdminGetTodayCertifiedEnterprises(c *gin.Context) { // @Router /api/v1/statistics/api-popularity-ranking [get] func (h *StatisticsHandler) GetPublicApiPopularityRanking(c *gin.Context) { period := c.DefaultQuery("period", "today") // 默认日度 - limit := h.getIntQuery(c, "limit", 10) // 默认10条 + limit := h.getIntQuery(c, "limit", 10) // 默认10条 // 调用应用服务获取API受欢迎程度排行榜 result, err := h.statisticsAppService.AdminGetApiPopularityRanking(c.Request.Context(), period, limit) @@ -1550,4 +1550,4 @@ func (h *StatisticsHandler) GetPublicApiPopularityRanking(c *gin.Context) { } h.responseBuilder.Success(c, []ApiPopularityRankingItem{}, "获取API受欢迎程度排行榜成功") -} \ No newline at end of file +} diff --git a/internal/infrastructure/http/routes/statistics_routes.go b/internal/infrastructure/http/routes/statistics_routes.go index 8fff53f..40b9cc1 100644 --- a/internal/infrastructure/http/routes/statistics_routes.go +++ b/internal/infrastructure/http/routes/statistics_routes.go @@ -48,6 +48,9 @@ func (r *StatisticsRoutes) Register(router *sharedhttp.GinRouter) { // 获取API受欢迎榜单(公开接口) statistics.GET("/api-popularity-ranking", r.statisticsHandler.GetPublicApiPopularityRanking) + + // 获取最新产品推荐(公开接口) + statistics.GET("/latest-products", r.statisticsHandler.GetLatestProducts) } // 用户统计接口 - 需要认证 @@ -61,9 +64,6 @@ func (r *StatisticsRoutes) Register(router *sharedhttp.GinRouter) { userStats.GET("/consumption", r.statisticsHandler.GetConsumptionStatistics) userStats.GET("/recharge", r.statisticsHandler.GetRechargeStatistics) - // 获取最新产品推荐 - userStats.GET("/latest-products", r.statisticsHandler.GetLatestProducts) - // 获取指标列表 userStats.GET("/metrics", r.statisticsHandler.GetMetrics)