From 9a30a3a8d3862a9b2ce898535b7cb51c3ddac816 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期三, 20 五月 2026 16:01:11 +0800
Subject: [PATCH] refactor(controller): 将控制器响应结果统一为R类型并继承BaseController
---
src/main/java/com/ruoyi/project/monitor/controller/ServerController.java | 55 ++++++++++++++++++++++++++++---------------------------
1 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java b/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java
index 9a50b05..a2db092 100644
--- a/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java
+++ b/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java
@@ -1,27 +1,28 @@
-package com.ruoyi.project.monitor.controller;
-
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.domain.Server;
-
-/**
- * 鏈嶅姟鍣ㄧ洃鎺�
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/monitor/server")
-public class ServerController
-{
- @PreAuthorize("@ss.hasPermi('monitor:server:list')")
- @GetMapping()
- public AjaxResult getInfo() throws Exception
- {
- Server server = new Server();
- server.copyTo();
- return AjaxResult.success(server);
- }
-}
+package com.ruoyi.project.monitor.controller;
+
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.R;
+import com.ruoyi.framework.web.domain.Server;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 鏈嶅姟鍣ㄧ洃鎺�
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/monitor/server")
+public class ServerController extends BaseController
+{
+ @PreAuthorize("@ss.hasPermi('monitor:server:list')")
+ @GetMapping()
+ public R<?> getInfo() throws Exception
+ {
+ Server server = new Server();
+ server.copyTo();
+ return R.ok(server);
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.3