refactor: 重构仪表盘查询地域分析接口

This commit is contained in:
2024-11-04 20:59:47 +08:00
parent b927470e33
commit e0e157f0e5
6 changed files with 83 additions and 46 deletions

View File

@@ -31,11 +31,15 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.continew.admin.common.constant.CacheConstants;
import top.continew.admin.system.model.resp.dashboard.*;
import top.continew.admin.system.model.resp.dashboard.DashboardAccessTrendResp;
import top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp;
import top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp;
import top.continew.admin.system.model.resp.dashboard.DashboardOverviewCommonResp;
import top.continew.admin.system.service.DashboardService;
import top.continew.starter.core.util.validate.ValidationUtils;
import top.continew.starter.log.core.annotation.Log;
import java.io.IOException;
import java.util.List;
/**
@@ -72,6 +76,15 @@ public class DashboardController {
return dashboardService.getOverviewIp();
}
@Operation(summary = "查询地域分析", description = "查询地域分析")
@GetMapping("/analysis/geo")
@CachePenetrationProtect
@CacheRefresh(refresh = 7200)
@Cached(key = "'GEO'", name = CacheConstants.DASHBOARD_KEY_PREFIX, cacheType = CacheType.BOTH, syncLocal = true)
public List<DashboardChartCommonResp> getAnalysisGeo() throws IOException {
return dashboardService.getAnalysisGeo();
}
@Operation(summary = "查询访问趋势信息", description = "查询访问趋势信息")
@Parameter(name = "days", description = "日期数", example = "30", in = ParameterIn.PATH)
@GetMapping("/access/trend/{days}")
@@ -92,15 +105,6 @@ public class DashboardController {
return dashboardService.getAnalysisTimeslot();
}
@Operation(summary = "查询地域分析", description = "查询地域分析")
@GetMapping("/analysis/geo")
@CachePenetrationProtect
@CacheRefresh(refresh = 7200)
@Cached(key = "'GEO'", name = CacheConstants.DASHBOARD_KEY_PREFIX, cacheType = CacheType.BOTH, syncLocal = true)
public List<DashboardChartCommonResp> getAnalysisGeo() {
return dashboardService.getAnalysisGeo();
}
@Operation(summary = "查询模块分析", description = "查询模块分析")
@GetMapping("/analysis/module")
@CachePenetrationProtect

File diff suppressed because one or more lines are too long