|
|
|
@@ -126,6 +126,30 @@ func queryUserDataPage(ctx *context.Context, tableName string, queryObj interfac |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func QueryMetrics(ctx *context.Context) { |
|
|
|
startDate := ctx.Query("startDate") |
|
|
|
endDate := ctx.Query("endDate") |
|
|
|
startTime, _ := time.ParseInLocation("2006-01-02", startDate, time.Local) |
|
|
|
endTime, _ := time.ParseInLocation("2006-01-02", endDate, time.Local) |
|
|
|
result, count := models.QueryMetrics(startTime.Unix(), endTime.Unix()) |
|
|
|
mapInterface := make(map[string]interface{}) |
|
|
|
mapInterface["data"] = result |
|
|
|
mapInterface["count"] = count |
|
|
|
ctx.JSON(http.StatusOK, mapInterface) |
|
|
|
} |
|
|
|
|
|
|
|
func QueryRankingList(ctx *context.Context) { |
|
|
|
key := ctx.Query("key") |
|
|
|
tableName := ctx.Query("tableName") |
|
|
|
limit := ctx.QueryInt("limit") |
|
|
|
|
|
|
|
result, count := models.QueryRankList(key, tableName, limit) |
|
|
|
mapInterface := make(map[string]interface{}) |
|
|
|
mapInterface["data"] = result |
|
|
|
mapInterface["count"] = count |
|
|
|
ctx.JSON(http.StatusOK, mapInterface) |
|
|
|
} |
|
|
|
|
|
|
|
func QueryUserStaticCurrentMonth(ctx *context.Context) { |
|
|
|
queryUserDataPage(ctx, "public.user_business_analysis_current_month", new(models.UserBusinessAnalysisCurrentMonth)) |
|
|
|
} |
|
|
|
|