1
13693261870
2024-11-29 0b015d218928e6607250feeb0d093e55e73488f5
se-modules/se-system/src/main/java/com/se/system/controller/IndexController.java
@@ -41,8 +41,12 @@
    // PV反映了网站用户访问的网页数量,是衡量网站流量的重要指标之一
    @Log(title = "PV统计", businessType = BusinessType.OTHER)
    @GetMapping("/pvCount")
    public Map<String, Object> pvCount() {
    public Map<String, Object> pvCount(Integer day) {
        if (null == day || day < 1) day = 15;
        if (day > 365) day = 365;
        Map<String, Object> map = new HashMap<>();
        map.put("pvCount", indexService.pvCount(day));
        return map;
    }
@@ -52,8 +56,12 @@
    // 如果更换了IP后但不清除cookies,再访问相同网站,该网站的统计中UV数是不变的。
    @Log(title = "UV统计", businessType = BusinessType.OTHER)
    @GetMapping("/uvCount")
    public Map<String, Object> uvCount() {
    public Map<String, Object> uvCount(Integer day) {
        if (null == day || day < 1) day = 15;
        if (day > 365) day = 365;
        Map<String, Object> map = new HashMap<>();
        map.put("uvCount", indexService.uvCount(day));
        return map;
    }
@@ -62,10 +70,24 @@
    @Log(title = "新增用户统计", businessType = BusinessType.OTHER)
    @GetMapping("/newUserCount")
    public Map<String, Object> newUserCount(Integer day) {
        if (null == day || day < 1) day = 7;
        if (null == day || day < 1) day = 15;
        if (day > 365) day = 365;
        Map<String, Object> map = new HashMap<>();
        map.put("newUserCount", indexService.newUserCount(day));
        return map;
    }
    @Log(title = "数据统计", businessType = BusinessType.OTHER)
    @GetMapping("/dataCount")
    public Map<String, Object> dataCount(Integer day) {
        if (null == day || day < 1) day = 15;
        if (day > 365) day = 365;
        Map<String, Object> map = new HashMap<>();
        map.put("pvCount", indexService.pvCount(day));
        map.put("uvCount", indexService.uvCount(day));
        map.put("newUserCount", indexService.newUserCount(day));
        return map;
@@ -84,20 +106,26 @@
    // ⑤用户统计排行(活跃用户):以一定时间段内的登录时间或登录次数排名,展示前五名的用户信息
    @Log(title = "用户统计排行", businessType = BusinessType.OTHER)
    @GetMapping("/userCountList")
    public Map<String, Object> userCountList() {
        Map<String, Object> map = new HashMap<>();
    public List<Map<String, Object>> userCountList(Integer day, Integer amount) {
        if (null == day || day < 1) day = 15;
        if (day > 365) day = 365;
        if (null == amount) amount = 5;
        if (amount > 100) amount = 100;
        return map;
        return indexService.userCountList(day, amount);
    }
    // ⑥常用系统展示/各系统访问信息:基于用户访问次数排名,展示前五个系统的排名
    // 并展示各个系统一天内、三天内、一周内的访问次数。【可考虑按其他指标进行排名展示】
    @Log(title = "用户统计排行", businessType = BusinessType.OTHER)
    @Log(title = "常用系统展示", businessType = BusinessType.OTHER)
    @GetMapping("/sysVisitList")
    public Map<String, Object> sysVisitList() {
        Map<String, Object> map = new HashMap<>();
    public List<Map<String, Object>> sysVisitList(Integer day, Integer amount) {
        if (null == day || day < 1) day = 15;
        if (day > 365) day = 365;
        if (null == amount) amount = 5;
        if (amount > 100) amount = 100;
        return map;
        return indexService.sysVisitList(day, amount);
    }
    @Log(title = "运维监控", businessType = BusinessType.OTHER)