Skip to content

Commit dea8dbe

Browse files
committed
feat: 新增仪表盘分析接口,查询访问时段分析、查询模块分析、查询终端分析、查询浏览器分析
1 parent ffdc971 commit dea8dbe

File tree

16 files changed

+294
-182
lines changed

16 files changed

+294
-182
lines changed

continew-admin-system/src/main/java/top/continew/admin/system/mapper/LogMapper.java

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
import com.baomidou.mybatisplus.core.toolkit.Constants;
2222
import org.apache.ibatis.annotations.Param;
2323
import top.continew.admin.system.model.entity.LogDO;
24-
import top.continew.admin.system.model.resp.DashboardAccessTrendResp;
25-
import top.continew.admin.system.model.resp.DashboardPopularModuleResp;
26-
import top.continew.admin.system.model.resp.DashboardTotalResp;
24+
import top.continew.admin.system.model.resp.dashboard.DashboardAccessTrendResp;
25+
import top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp;
26+
import top.continew.admin.system.model.resp.dashboard.DashboardTotalResp;
2727
import top.continew.admin.system.model.resp.log.LogResp;
2828
import top.continew.starter.data.mp.base.BaseMapper;
2929

3030
import java.util.List;
31-
import java.util.Map;
3231

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

7473
/**
75-
* 查询仪表盘热门模块列表
74+
* 查询仪表盘访问时段分析信息
7675
*
77-
* @return 仪表盘热门模块列表
76+
* @return 仪表盘访问时段分析信息
7877
*/
79-
List<DashboardPopularModuleResp> selectListDashboardPopularModule();
78+
List<DashboardChartCommonResp> selectListDashboardAnalysisTimeslot();
8079

8180
/**
82-
* 查询仪表盘访客地域分布信息
81+
* 查询仪表盘地域分析信息
8382
*
84-
* @return 仪表盘访客地域分布信息
83+
* @param top 显示数量
84+
* @return 仪表盘地域分析信息
8585
*/
86-
List<Map<String, Object>> selectListDashboardGeoDistribution();
86+
List<DashboardChartCommonResp> selectListDashboardAnalysisGeo(@Param("top") Integer top);
87+
88+
/**
89+
* 查询仪表盘模块分析信息
90+
*
91+
* @param top 显示数量
92+
* @return 仪表盘模块分析信息
93+
*/
94+
List<DashboardChartCommonResp> selectListDashboardAnalysisModule(@Param("top") Integer top);
95+
96+
/**
97+
* 查询仪表盘终端分析信息
98+
*
99+
* @param top 显示数量
100+
* @return 仪表盘终端分析信息
101+
*/
102+
List<DashboardChartCommonResp> selectListDashboardAnalysisOs(@Param("top") Integer top);
103+
104+
/**
105+
* 查询仪表盘浏览器分析信息
106+
*
107+
* @param top 显示数量
108+
* @return 仪表盘浏览器分析信息
109+
*/
110+
List<DashboardChartCommonResp> selectListDashboardAnalysisBrowser(@Param("top") Integer top);
87111
}

continew-admin-system/src/main/java/top/continew/admin/system/mapper/NoticeMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package top.continew.admin.system.mapper;
1818

1919
import top.continew.admin.system.model.entity.NoticeDO;
20-
import top.continew.admin.system.model.resp.DashboardNoticeResp;
20+
import top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp;
2121
import top.continew.starter.data.mp.base.BaseMapper;
2222

2323
import java.util.List;

continew-admin-system/src/main/java/top/continew/admin/system/model/resp/DashboardPopularModuleResp.java

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package top.continew.admin.system.model.resp;
17+
package top.continew.admin.system.model.resp.dashboard;
1818

1919
import io.swagger.v3.oas.annotations.media.Schema;
2020
import lombok.Data;
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,40 @@
1414
* limitations under the License.
1515
*/
1616

17-
package top.continew.admin.system.model.resp;
17+
package top.continew.admin.system.model.resp.dashboard;
1818

1919
import io.swagger.v3.oas.annotations.media.Schema;
20+
import lombok.AllArgsConstructor;
2021
import lombok.Data;
22+
import lombok.NoArgsConstructor;
2123

2224
import java.io.Serial;
2325
import java.io.Serializable;
24-
import java.util.List;
25-
import java.util.Map;
2626

2727
/**
28-
* 仪表盘-访客地域分布信息
28+
* 仪表盘-通用图表信息
2929
*
3030
* @author Charles7c
31-
* @since 2023/9/9 12:07
31+
* @since 2024/10/17 21:37
3232
*/
3333
@Data
34-
@Schema(description = "仪表盘-访客地域分布信息")
35-
public class DashboardGeoDistributionResp implements Serializable {
34+
@NoArgsConstructor
35+
@AllArgsConstructor
36+
@Schema(description = "仪表盘-通用图表信息")
37+
public class DashboardChartCommonResp implements Serializable {
3638

3739
@Serial
3840
private static final long serialVersionUID = 1L;
3941

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

4648
/**
47-
* 地点 IP 统计信息
49+
* 数量
4850
*/
49-
@Schema(description = "地点 IP 统计信息", example = "[{\"name\":\"中国北京北京市\",\"value\":1000},{\"name\":\"中国广东省深圳市\",\"value\": 500}]")
50-
private List<Map<String, Object>> locationIpStatistics;
51+
@Schema(description = "数量", example = "1234")
52+
private Long value;
5153
}

continew-admin-system/src/main/java/top/continew/admin/system/model/resp/DashboardNoticeResp.java renamed to continew-admin-system/src/main/java/top/continew/admin/system/model/resp/dashboard/DashboardNoticeResp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package top.continew.admin.system.model.resp;
17+
package top.continew.admin.system.model.resp.dashboard;
1818

1919
import io.swagger.v3.oas.annotations.media.Schema;
2020
import lombok.Data;

continew-admin-system/src/main/java/top/continew/admin/system/model/resp/DashboardTotalResp.java renamed to continew-admin-system/src/main/java/top/continew/admin/system/model/resp/dashboard/DashboardTotalResp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package top.continew.admin.system.model.resp;
17+
package top.continew.admin.system.model.resp.dashboard;
1818

1919
import com.fasterxml.jackson.annotation.JsonIgnore;
2020
import io.swagger.v3.oas.annotations.media.Schema;

continew-admin-system/src/main/java/top/continew/admin/system/service/DashboardService.java

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package top.continew.admin.system.service;
1818

19-
import top.continew.admin.system.model.resp.*;
19+
import top.continew.admin.system.model.resp.dashboard.*;
2020

2121
import java.util.List;
2222

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

4646
/**
47-
* 查询热门模块列表
47+
* 查询公告列表
4848
*
49-
* @return 热门模块列表
49+
* @return 公告列表
5050
*/
51-
List<DashboardPopularModuleResp> listPopularModule();
51+
List<DashboardNoticeResp> listNotice();
5252

5353
/**
54-
* 查询访客地域分布信息
54+
* 查询访问时段分析信息
5555
*
56-
* @return 访客地域分布信息
56+
* @return 访问时段分析信息
5757
*/
58-
DashboardGeoDistributionResp getGeoDistribution();
58+
List<DashboardChartCommonResp> getAnalysisTimeslot();
5959

6060
/**
61-
* 查询公告列表
61+
* 查询地域分析信息
6262
*
63-
* @return 公告列表
63+
* @return 地域分析信息
6464
*/
65-
List<DashboardNoticeResp> listNotice();
65+
List<DashboardChartCommonResp> getAnalysisGeo();
66+
67+
/**
68+
* 查询模块分析信息
69+
*
70+
* @return 模块分析信息
71+
*/
72+
List<DashboardChartCommonResp> getAnalysisModule();
73+
74+
/**
75+
* 查询终端分析信息
76+
*
77+
* @return 终端分析信息
78+
*/
79+
List<DashboardChartCommonResp> getAnalysisOs();
80+
81+
/**
82+
* 查询浏览器分析信息
83+
*
84+
* @return 浏览器分析信息
85+
*/
86+
List<DashboardChartCommonResp> getAnalysisBrowser();
6687
}

continew-admin-system/src/main/java/top/continew/admin/system/service/LogService.java

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@
1818

1919
import jakarta.servlet.http.HttpServletResponse;
2020
import top.continew.admin.system.model.query.LogQuery;
21-
import top.continew.admin.system.model.resp.DashboardAccessTrendResp;
22-
import top.continew.admin.system.model.resp.DashboardPopularModuleResp;
23-
import top.continew.admin.system.model.resp.DashboardTotalResp;
21+
import top.continew.admin.system.model.resp.dashboard.DashboardAccessTrendResp;
22+
import top.continew.admin.system.model.resp.dashboard.DashboardChartCommonResp;
23+
import top.continew.admin.system.model.resp.dashboard.DashboardTotalResp;
2424
import top.continew.admin.system.model.resp.log.LogDetailResp;
2525
import top.continew.admin.system.model.resp.log.LogResp;
2626
import top.continew.starter.extension.crud.model.query.PageQuery;
2727
import top.continew.starter.extension.crud.model.query.SortQuery;
2828
import top.continew.starter.extension.crud.model.resp.PageResp;
2929

3030
import java.util.List;
31-
import java.util.Map;
3231

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

9190
/**
92-
* 查询仪表盘热门模块列表
91+
* 查询仪表盘访问时段分析信息
9392
*
94-
* @return 仪表盘热门模块列表
93+
* @return 仪表盘访问时段分析信息
9594
*/
96-
List<DashboardPopularModuleResp> listDashboardPopularModule();
95+
List<DashboardChartCommonResp> listDashboardAnalysisTimeslot();
9796

9897
/**
99-
* 查询仪表盘访客地域分布信息
98+
* 查询仪表盘地域分析信息
99+
*
100+
* @param top 显示数量
101+
* @return 仪表盘地域分析信息
102+
*/
103+
List<DashboardChartCommonResp> listDashboardAnalysisGeo(int top);
104+
105+
/**
106+
* 查询仪表盘模块分析信息
107+
*
108+
* @param top 显示数量
109+
* @return 仪表盘模块分析信息
110+
*/
111+
List<DashboardChartCommonResp> listDashboardAnalysisModule(int top);
112+
113+
/**
114+
* 查询仪表盘终端分析信息
115+
*
116+
* @param top 显示数量
117+
* @return 仪表盘终端分析信息
118+
*/
119+
List<DashboardChartCommonResp> listDashboardAnalysisOs(int top);
120+
121+
/**
122+
* 查询仪表盘浏览器分析信息
100123
*
101-
* @return 仪表盘访客地域分布信息
124+
* @param top 显示数量
125+
* @return 仪表盘浏览器分析信息
102126
*/
103-
List<Map<String, Object>> listDashboardGeoDistribution();
127+
List<DashboardChartCommonResp> listDashboardAnalysisBrowser(int top);
104128
}

continew-admin-system/src/main/java/top/continew/admin/system/service/NoticeService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import top.continew.admin.system.model.req.NoticeReq;
2222
import top.continew.admin.system.model.resp.NoticeDetailResp;
2323
import top.continew.admin.system.model.resp.NoticeResp;
24-
import top.continew.admin.system.model.resp.DashboardNoticeResp;
24+
import top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp;
2525
import top.continew.starter.extension.crud.service.BaseService;
2626
import top.continew.starter.data.mp.service.IService;
2727

0 commit comments

Comments
 (0)