add newapilist

This commit is contained in:
Mrx
2026-03-23 15:34:27 +08:00
parent e03e6b983c
commit 5e658f2527
2 changed files with 6 additions and 6 deletions

View File

@@ -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受欢迎程度排行榜成功")
}
}

View File

@@ -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)