|
@@ -36,9 +36,10 @@ import java.util.stream.Collectors;
|
|
|
public class DMPDataController {
|
|
|
|
|
|
@Autowired private IGADailyReportService gaDailyReportService;
|
|
|
- @Autowired private IGASourceMediumReportService gaSourceMediumReportService;
|
|
|
@Autowired private IGACountryReportService gaCountryReportService;
|
|
|
+ @Autowired private IGASourceMediumReportService gaSourceMediumReportService;
|
|
|
@Autowired private IGAPagePathReportService gaPagePathReportService;
|
|
|
+ @Autowired private IGADeviceReportService gaDeviceReportService;
|
|
|
@Autowired private IEnquiryReportService enquiryReportService;
|
|
|
|
|
|
/** 首页:网站流量按时间段分析统计 - 今天,昨天,本周,上周等 */
|
|
@@ -76,8 +77,8 @@ public class DMPDataController {
|
|
|
return Result.ok(SiteOverviewStatsVO.fromDailyStats(dailyStatsVOs));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/source-medium/stats")
|
|
|
- public Result<List<SourceMediumStatsVO>> getSourceMediumStats(
|
|
|
+ @GetMapping("/country/stats")
|
|
|
+ public Result<List<CountryStatsVO>> getCountryStats(
|
|
|
String siteCode,
|
|
|
String dateType,
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
|
|
@@ -90,11 +91,11 @@ public class DMPDataController {
|
|
|
}
|
|
|
|
|
|
// 2. 查询并返回
|
|
|
- return Result.ok(gaSourceMediumReportService.getSourceMediumStats(siteCode, start, end));
|
|
|
+ return Result.ok(gaCountryReportService.getCountryStats(siteCode, start, end));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/country/stats")
|
|
|
- public Result<List<CountryStatsVO>> getCountryStats(
|
|
|
+ @GetMapping("/source-medium/stats")
|
|
|
+ public Result<List<SourceMediumStatsVO>> getSourceMediumStats(
|
|
|
String siteCode,
|
|
|
String dateType,
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
|
|
@@ -107,7 +108,7 @@ public class DMPDataController {
|
|
|
}
|
|
|
|
|
|
// 2. 查询并返回
|
|
|
- return Result.ok(gaCountryReportService.getCountryStats(siteCode, start, end));
|
|
|
+ return Result.ok(gaSourceMediumReportService.getSourceMediumStats(siteCode, start, end));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/page-path/stats")
|
|
@@ -130,6 +131,23 @@ public class DMPDataController {
|
|
|
siteCode, start, end, limit >= 0 ? limit : 10));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/device/stats")
|
|
|
+ public Result<List<DeviceStatsVO>> getDeviceStats(
|
|
|
+ String siteCode,
|
|
|
+ String dateType,
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd") Date start,
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd") Date end) {
|
|
|
+ // 1. 计算时间区间
|
|
|
+ if (StringUtils.isNotBlank(dateType)) {
|
|
|
+ Pair<Date, Date> dateRange = DateUtil.getDateRangeByType(dateType);
|
|
|
+ start = dateRange.getLeft();
|
|
|
+ end = dateRange.getRight();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 查询并返回
|
|
|
+ return Result.ok(gaDeviceReportService.getDeviceStats(siteCode, start, end));
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/enquiry-country/stats")
|
|
|
public Result<List<EnquiryCountryStatsVO>> getEnquiryCountryStats(
|
|
|
String siteCode,
|