From 1b77c2724e38d087f3eab4a2f27b3b165f4265dc Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 25 五月 2026 14:37:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_tide' into dev_tide
---
src/main/java/com/ruoyi/safety/controller/SafetyControllerSupport.java | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/safety/controller/SafetyControllerSupport.java b/src/main/java/com/ruoyi/safety/controller/SafetyControllerSupport.java
new file mode 100644
index 0000000..4046962
--- /dev/null
+++ b/src/main/java/com/ruoyi/safety/controller/SafetyControllerSupport.java
@@ -0,0 +1,31 @@
+package com.ruoyi.safety.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.framework.web.domain.AjaxResult;
+
+/**
+ * 瀹夌幆绠$悊 Controller 鍏叡鏂规硶銆�
+ */
+public abstract class SafetyControllerSupport {
+
+ /**
+ * 鍏煎 MyBatis Plus 鐨� current/size 涓庢枃妗d腑鐨� pageNum/pageSize 鍒嗛〉鍙傛暟銆�
+ */
+ protected <T> Page<T> buildPage(Page<T> page, Long pageNum, Long pageSize) {
+ Page<T> result = page == null ? new Page<T>() : page;
+ if (pageNum != null) {
+ result.setCurrent(pageNum);
+ }
+ if (pageSize != null) {
+ result.setSize(pageSize);
+ }
+ return result;
+ }
+
+ /**
+ * 灏嗗竷灏斿鐞嗙粨鏋滆浆鎹负缁熶竴鍝嶅簲銆�
+ */
+ protected AjaxResult toAjax(boolean success) {
+ return success ? AjaxResult.success() : AjaxResult.error();
+ }
+}
--
Gitblit v1.9.3