Skip to content

Commit

Permalink
feat: 新增仪表盘分析接口,查询访问时段分析、查询模块分析、查询终端分析、查询浏览器分析
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 17, 2024
1 parent ffdc971 commit dea8dbe
Show file tree
Hide file tree
Showing 16 changed files with 294 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import top.continew.admin.system.model.entity.LogDO;
import top.continew.admin.system.model.resp.DashboardAccessTrendResp;
import top.continew.admin.system.model.resp.DashboardPopularModuleResp;
import top.continew.admin.system.model.resp.DashboardTotalResp;
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.DashboardTotalResp;
import top.continew.admin.system.model.resp.log.LogResp;
import top.continew.starter.data.mp.base.BaseMapper;

import java.util.List;
import java.util.Map;

/**
* 系统日志 Mapper
Expand Down Expand Up @@ -72,16 +71,41 @@ IPage<LogResp> selectLogPage(@Param("page") IPage<LogDO> page,
List<DashboardAccessTrendResp> selectListDashboardAccessTrend(@Param("days") Integer days);

/**
* 查询仪表盘热门模块列表
* 查询仪表盘访问时段分析信息
*
* @return 仪表盘热门模块列表
* @return 仪表盘访问时段分析信息
*/
List<DashboardPopularModuleResp> selectListDashboardPopularModule();
List<DashboardChartCommonResp> selectListDashboardAnalysisTimeslot();

/**
* 查询仪表盘访客地域分布信息
* 查询仪表盘地域分析信息
*
* @return 仪表盘访客地域分布信息
* @param top 显示数量
* @return 仪表盘地域分析信息
*/
List<Map<String, Object>> selectListDashboardGeoDistribution();
List<DashboardChartCommonResp> selectListDashboardAnalysisGeo(@Param("top") Integer top);

/**
* 查询仪表盘模块分析信息
*
* @param top 显示数量
* @return 仪表盘模块分析信息
*/
List<DashboardChartCommonResp> selectListDashboardAnalysisModule(@Param("top") Integer top);

/**
* 查询仪表盘终端分析信息
*
* @param top 显示数量
* @return 仪表盘终端分析信息
*/
List<DashboardChartCommonResp> selectListDashboardAnalysisOs(@Param("top") Integer top);

/**
* 查询仪表盘浏览器分析信息
*
* @param top 显示数量
* @return 仪表盘浏览器分析信息
*/
List<DashboardChartCommonResp> selectListDashboardAnalysisBrowser(@Param("top") Integer top);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package top.continew.admin.system.mapper;

import top.continew.admin.system.model.entity.NoticeDO;
import top.continew.admin.system.model.resp.DashboardNoticeResp;
import top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp;
import top.continew.starter.data.mp.base.BaseMapper;

import java.util.List;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.dashboard;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,40 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.dashboard;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
* 仪表盘-访客地域分布信息
* 仪表盘-通用图表信息
*
* @author Charles7c
* @since 2023/9/9 12:07
* @since 2024/10/17 21:37
*/
@Data
@Schema(description = "仪表盘-访客地域分布信息")
public class DashboardGeoDistributionResp implements Serializable {
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "仪表盘-通用图表信息")
public class DashboardChartCommonResp implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

/**
* 地点列表
* 名称
*/
@Schema(description = "地点列表", example = "[\"中国北京北京市\",\"中国广东省深圳市\"]")
private List<String> locations;
@Schema(description = "名称", example = "Windows 10")
private String name;

/**
* 地点 IP 统计信息
* 数量
*/
@Schema(description = "地点 IP 统计信息", example = "[{\"name\":\"中国北京北京市\",\"value\":1000},{\"name\":\"中国广东省深圳市\",\"value\": 500}]")
private List<Map<String, Object>> locationIpStatistics;
@Schema(description = "数量", example = "1234")
private Long value;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.dashboard;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.dashboard;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package top.continew.admin.system.service;

import top.continew.admin.system.model.resp.*;
import top.continew.admin.system.model.resp.dashboard.*;

import java.util.List;

Expand Down Expand Up @@ -44,23 +44,44 @@ public interface DashboardService {
List<DashboardAccessTrendResp> listAccessTrend(Integer days);

/**
* 查询热门模块列表
* 查询公告列表
*
* @return 热门模块列表
* @return 公告列表
*/
List<DashboardPopularModuleResp> listPopularModule();
List<DashboardNoticeResp> listNotice();

/**
* 查询访客地域分布信息
* 查询访问时段分析信息
*
* @return 访客地域分布信息
* @return 访问时段分析信息
*/
DashboardGeoDistributionResp getGeoDistribution();
List<DashboardChartCommonResp> getAnalysisTimeslot();

/**
* 查询公告列表
* 查询地域分析信息
*
* @return 公告列表
* @return 地域分析信息
*/
List<DashboardNoticeResp> listNotice();
List<DashboardChartCommonResp> getAnalysisGeo();

/**
* 查询模块分析信息
*
* @return 模块分析信息
*/
List<DashboardChartCommonResp> getAnalysisModule();

/**
* 查询终端分析信息
*
* @return 终端分析信息
*/
List<DashboardChartCommonResp> getAnalysisOs();

/**
* 查询浏览器分析信息
*
* @return 浏览器分析信息
*/
List<DashboardChartCommonResp> getAnalysisBrowser();
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@

import jakarta.servlet.http.HttpServletResponse;
import top.continew.admin.system.model.query.LogQuery;
import top.continew.admin.system.model.resp.DashboardAccessTrendResp;
import top.continew.admin.system.model.resp.DashboardPopularModuleResp;
import top.continew.admin.system.model.resp.DashboardTotalResp;
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.DashboardTotalResp;
import top.continew.admin.system.model.resp.log.LogDetailResp;
import top.continew.admin.system.model.resp.log.LogResp;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.query.SortQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;

import java.util.List;
import java.util.Map;

/**
* 系统日志业务接口
Expand Down Expand Up @@ -89,16 +88,41 @@ public interface LogService {
List<DashboardAccessTrendResp> listDashboardAccessTrend(Integer days);

/**
* 查询仪表盘热门模块列表
* 查询仪表盘访问时段分析信息
*
* @return 仪表盘热门模块列表
* @return 仪表盘访问时段分析信息
*/
List<DashboardPopularModuleResp> listDashboardPopularModule();
List<DashboardChartCommonResp> listDashboardAnalysisTimeslot();

/**
* 查询仪表盘访客地域分布信息
* 查询仪表盘地域分析信息
*
* @param top 显示数量
* @return 仪表盘地域分析信息
*/
List<DashboardChartCommonResp> listDashboardAnalysisGeo(int top);

/**
* 查询仪表盘模块分析信息
*
* @param top 显示数量
* @return 仪表盘模块分析信息
*/
List<DashboardChartCommonResp> listDashboardAnalysisModule(int top);

/**
* 查询仪表盘终端分析信息
*
* @param top 显示数量
* @return 仪表盘终端分析信息
*/
List<DashboardChartCommonResp> listDashboardAnalysisOs(int top);

/**
* 查询仪表盘浏览器分析信息
*
* @return 仪表盘访客地域分布信息
* @param top 显示数量
* @return 仪表盘浏览器分析信息
*/
List<Map<String, Object>> listDashboardGeoDistribution();
List<DashboardChartCommonResp> listDashboardAnalysisBrowser(int top);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import top.continew.admin.system.model.req.NoticeReq;
import top.continew.admin.system.model.resp.NoticeDetailResp;
import top.continew.admin.system.model.resp.NoticeResp;
import top.continew.admin.system.model.resp.DashboardNoticeResp;
import top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp;
import top.continew.starter.extension.crud.service.BaseService;
import top.continew.starter.data.mp.service.IService;

Expand Down
Loading

0 comments on commit dea8dbe

Please sign in to comment.