| | |
| | | |
| | | @GetMapping("/overview") |
| | | @Operation(summary = "获得数据概览") |
| | | @PreAuthorize("@ss.hasPermission('im:manager:statistics:query')") |
| | | public CommonResult<ImStatisticsManagerOverviewRespVO> getOverview() { |
| | | LocalDateTime todayBegin = LocalDate.now().atStartOfDay(); |
| | | LocalDateTime tomorrowBegin = todayBegin.plusDays(1); |
| | |
| | | @GetMapping("/message-trend") |
| | | @Operation(summary = "获得消息趋势(私聊 / 群聊双线)") |
| | | @Parameter(name = "days", description = "回看天数(含今日)", example = "7") |
| | | @PreAuthorize("@ss.hasPermission('im:manager:statistics:query')") |
| | | public CommonResult<ImStatisticsManagerTrendRespVO> getMessageTrend( |
| | | @RequestParam(value = "days", defaultValue = "7") @Min(1) @Max(90) int days) { |
| | | List<LocalDateTime> dates = LocalDateTimeUtils.getLatestDays(days); |
| | |
| | | @GetMapping("/user-trend") |
| | | @Operation(summary = "获得用户趋势(新增注册 / 日活双线)") |
| | | @Parameter(name = "days", description = "回看天数(含今日)", example = "7") |
| | | @PreAuthorize("@ss.hasPermission('im:manager:statistics:query')") |
| | | public CommonResult<ImStatisticsManagerTrendRespVO> getUserTrend( |
| | | @RequestParam(value = "days", defaultValue = "7") @Min(1) @Max(90) int days) { |
| | | List<LocalDateTime> dates = LocalDateTimeUtils.getLatestDays(days); |
| | |
| | | |
| | | @GetMapping("/message-type-distribution") |
| | | @Operation(summary = "获得内容类型分布(最近 30 天)") |
| | | @PreAuthorize("@ss.hasPermission('im:manager:statistics:query')") |
| | | public CommonResult<List<ImStatisticsManagerMessageTypeRespVO>> getMessageTypeDistribution() { |
| | | LocalDateTime endTime = LocalDate.now().plusDays(1).atStartOfDay(); |
| | | LocalDateTime beginTime = endTime.minusDays(DISTRIBUTION_WINDOW_DAYS); |
| | |
| | | |
| | | @GetMapping("/group-size-distribution") |
| | | @Operation(summary = "获得群规模分布") |
| | | @PreAuthorize("@ss.hasPermission('im:manager:statistics:query')") |
| | | public CommonResult<List<ImStatisticsManagerGroupSizeRespVO>> getGroupSizeDistribution() { |
| | | Map<String, Long> groupSizeMap = statisticsService.getGroupSizeCountMap(); |
| | | // 转换格式 |
| | |
| | | |
| | | @GetMapping("/top-senders") |
| | | @Operation(summary = "获得消息 TOP 发送者(最近 30 天)") |
| | | @PreAuthorize("@ss.hasPermission('im:manager:statistics:query')") |
| | | public CommonResult<List<ImStatisticsManagerTopSenderRespVO>> getTopSenders() { |
| | | LocalDateTime endTime = LocalDate.now().plusDays(1).atStartOfDay(); |
| | | LocalDateTime beginTime = endTime.minusDays(DISTRIBUTION_WINDOW_DAYS); |