From 5ab5c03df7b21f5b8b2af1b8e382139274e6f9a1 Mon Sep 17 00:00:00 2001
From: liufan9527 <937359084@qq.com>
Date: 星期三, 27 十一月 2024 15:46:13 +0800
Subject: [PATCH] Merge branch 'master' of http://103.135.160.14:9034/r/se-cloud

---
 se-modules/se-system/src/main/java/com/se/system/controller/IndexController.java |  105 +++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 78 insertions(+), 27 deletions(-)

diff --git a/se-modules/se-system/src/main/java/com/se/system/controller/IndexController.java b/se-modules/se-system/src/main/java/com/se/system/controller/IndexController.java
index 541c9b4..1df023e 100644
--- a/se-modules/se-system/src/main/java/com/se/system/controller/IndexController.java
+++ b/se-modules/se-system/src/main/java/com/se/system/controller/IndexController.java
@@ -1,18 +1,18 @@
 package com.se.system.controller;
 
-import com.alibaba.fastjson2.JSON;
-import com.se.common.core.utils.ServletUtils;
-import com.se.common.core.utils.StringUtils;
 import com.se.common.core.utils.ip.IpUtils;
 import com.se.common.core.web.controller.BaseController;
 import com.se.common.core.web.domain.AjaxResult;
+import com.se.common.core.web.page.TableDataInfo;
 import com.se.common.log.annotation.Log;
 import com.se.common.log.enums.BusinessType;
 import com.se.common.security.utils.SecurityUtils;
+import com.se.system.api.domain.SysLogininfor;
 import com.se.system.api.domain.SysOperLog;
 import com.se.system.api.model.LoginUser;
+import com.se.system.service.IndexService;
+import com.se.system.service.inte.ISysLogininforService;
 import com.se.system.service.inte.ISysOperLogService;
-import org.springframework.http.HttpMethod;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -20,6 +20,7 @@
 import javax.annotation.Resource;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 @RestController
@@ -27,29 +28,18 @@
 @SuppressWarnings("ALL")
 public class IndexController extends BaseController {
     @Resource
+    IndexService indexService;
+
+    @Resource
     ISysOperLogService operLogService;
 
-    @GetMapping("/monitor")
-    public Map<String, Object> monitor() {
-        Map<String, Object> map = new HashMap<>();
+    @Resource
+    ISysLogininforService logininforService;
 
-        return map;
-    }
-
-    @GetMapping("/userList")
-    public Map<String, Object> userList() {
-        Map<String, Object> map = new HashMap<>();
-
-        return map;
-    }
-
-    @GetMapping("/uvCount")
-    public Map<String, Object> uvCount() {
-        Map<String, Object> map = new HashMap<>();
-
-        return map;
-    }
-
+    // 鈶燩V缁熻锛歅V锛圥age View锛夛細椤甸潰娴忚閲忔垨鐐瑰嚮閲忥紝鍗崇綉绔欐墍鏈夐〉闈㈣璁块棶鐨勬�绘鏁般��
+    // 姣忔墦寮�鎴栧埛鏂颁竴涓〉闈紝PV灏变細澧炲姞涓�娆★紝澶氭鎵撳紑鎴栧埛鏂板悓涓�椤甸潰鍒欐祻瑙堥噺绱銆�
+    // PV鍙嶆槧浜嗙綉绔欑敤鎴疯闂殑缃戦〉鏁伴噺锛屾槸琛¢噺缃戠珯娴侀噺鐨勯噸瑕佹寚鏍囦箣涓�
+    @Log(title = "PV缁熻", businessType = BusinessType.OTHER)
     @GetMapping("/pvCount")
     public Map<String, Object> pvCount() {
         Map<String, Object> map = new HashMap<>();
@@ -57,7 +47,70 @@
         return map;
     }
 
-    //@Log(title = "瑙掕壊绠$悊", businessType = BusinessType.INSERT)
+    // 鈶¤闂暟閲忥細UV锛圲nique Visitor锛夛細鐙珛璁垮鏁帮紝鎸囪闂綉绔欑殑鐙珛鐢ㄦ埛鏁般�備竴澶╁唴鍚屼竴璁垮澶氭璁块棶鍙绠椾竴娆°��
+    // 鍙互鐞嗚В鎴愯闂煇缃戠珯鐨勭數鑴戠殑鏁伴噺銆傜綉绔欏垽鏂潵璁跨數鑴戠殑韬唤鏄�氳繃鏉ヨ鐢佃剳鐨刢ookies瀹炵幇鐨勩��
+    // 濡傛灉鏇存崲浜咺P鍚庝絾涓嶆竻闄ookies锛屽啀璁块棶鐩稿悓缃戠珯锛岃缃戠珯鐨勭粺璁′腑UV鏁版槸涓嶅彉鐨勩��
+    @Log(title = "UV缁熻", businessType = BusinessType.OTHER)
+    @GetMapping("/uvCount")
+    public Map<String, Object> uvCount() {
+        Map<String, Object> map = new HashMap<>();
+
+        return map;
+    }
+
+    // 鈶㈡柊澧炵敤鎴风粺璁★細涓�娈垫椂闂村唴鏂版敞鍐岀殑鐢ㄦ埛鏁伴噺銆傜洰鍓嶅畾涓轰竴鍛ㄥ唴鐨勬柊澧炵敤鎴锋暟閲忋��
+    @Log(title = "鏂板鐢ㄦ埛缁熻", businessType = BusinessType.OTHER)
+    @GetMapping("/newUserCount")
+    public Map<String, Object> newUserCount(Integer day) {
+        if (null == day || day < 1) day = 7;
+        if (day > 365) day = 365;
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("newUserCount", indexService.newUserCount(day));
+
+        return map;
+    }
+
+    // 鈶g敤鎴风櫥褰曚俊鎭細浠ヤ竴瀹氬舰寮忓睍绀烘柊鐧诲綍鎴栭��鍑虹櫥褰曠殑鐢ㄦ埛璐︽埛鍙婃椂闂淬��
+    @Log(title = "鐢ㄦ埛鐧诲綍淇℃伅", businessType = BusinessType.OTHER)
+    @GetMapping("/lastLogin")
+    public TableDataInfo lastLogin(SysLogininfor logininfor) {
+        startPage();
+        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
+
+        return getDataTable(list);
+    }
+
+    // 鈶ょ敤鎴风粺璁℃帓琛岋紙娲昏穬鐢ㄦ埛锛夛細浠ヤ竴瀹氭椂闂存鍐呯殑鐧诲綍鏃堕棿鎴栫櫥褰曟鏁版帓鍚嶏紝灞曠ず鍓嶄簲鍚嶇殑鐢ㄦ埛淇℃伅
+    @Log(title = "鐢ㄦ埛缁熻鎺掕", businessType = BusinessType.OTHER)
+    @GetMapping("/userCountList")
+    public Map<String, Object> userCountList() {
+        Map<String, Object> map = new HashMap<>();
+
+        return map;
+    }
+
+    // 鈶ュ父鐢ㄧ郴缁熷睍绀�/鍚勭郴缁熻闂俊鎭細鍩轰簬鐢ㄦ埛璁块棶娆℃暟鎺掑悕锛屽睍绀哄墠浜斾釜绯荤粺鐨勬帓鍚�
+    // 骞跺睍绀哄悇涓郴缁熶竴澶╁唴銆佷笁澶╁唴銆佷竴鍛ㄥ唴鐨勮闂鏁般�傘�愬彲鑰冭檻鎸夊叾浠栨寚鏍囪繘琛屾帓鍚嶅睍绀恒��
+    @Log(title = "鐢ㄦ埛缁熻鎺掕", businessType = BusinessType.OTHER)
+    @GetMapping("/sysVisitList")
+    public Map<String, Object> sysVisitList() {
+        Map<String, Object> map = new HashMap<>();
+
+        return map;
+    }
+
+    @Log(title = "杩愮淮鐩戞帶", businessType = BusinessType.OTHER)
+    @GetMapping("/monitor")
+    public Map<String, Object> monitor() {
+        Map<String, Object> map = new HashMap<>();
+        map.put("cpu", "50%");
+        map.put("mem", "65%");
+        map.put("ratio", "40%");
+
+        return map;
+    }
+
     @GetMapping("/addAccessLog")
     public AjaxResult addAccessLog(String title, int status) {
         long start = System.currentTimeMillis();
@@ -91,5 +144,3 @@
         return toAjax(rows);
     }
 }
-
-

--
Gitblit v1.9.3