From d097cca97b1ab6717b37bce5cd48cca1c5ab69a1 Mon Sep 17 00:00:00 2001
From: guyue <1721849008@qq.com>
Date: 星期三, 09 七月 2025 19:36:05 +0800
Subject: [PATCH] 提问词excel,获取客户列表,

---
 src/main/java/com/linghu/controller/PlatformController.java |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/linghu/controller/PlatformController.java b/src/main/java/com/linghu/controller/PlatformController.java
index 5dcb8ff..6cc20bd 100644
--- a/src/main/java/com/linghu/controller/PlatformController.java
+++ b/src/main/java/com/linghu/controller/PlatformController.java
@@ -9,6 +9,7 @@
 import com.linghu.model.entity.Reference;
 import com.linghu.model.entity.Type;
 import com.linghu.model.excel.PlatformExcel;
+import com.linghu.model.page.CustomPage;
 import com.linghu.service.PlatformService;
 import com.linghu.service.TypeService;
 
@@ -87,11 +88,9 @@
             return ResponseResult.error("平台域名不能为空");
         }
 
-        boolean success = platformService.updateById(platform);
-        if (success) {
-            return ResponseResult.success();
-        }
-        return ResponseResult.error("更新平台失败");
+        platformService.updateById(platform);
+
+        return ResponseResult.success();
     }
 
     @GetMapping("/{platformId}")
@@ -105,15 +104,22 @@
     }
 
     @GetMapping("/list")
-    @ApiOperation("查询平台列表")
-    public ResponseResult<Page<Platform>> list(
-            @RequestParam(required = false,defaultValue = "1") Integer page,
-            @RequestParam(required = false,defaultValue = "10") Integer pageSize) {
-
+    @ApiOperation("查询平台列表,不传页数和大小就查全部")
+    public ResponseResult<CustomPage<Platform>> list(
+            @RequestParam(required = false) Integer page,
+            @RequestParam(required = false) Integer pageSize) {
+        if (page != null && pageSize != null) {
             Page<Platform> pageInfo = new Page<>(page, pageSize);
             Page<Platform> result = platformService.page(pageInfo);
-            return ResponseResult.success(result);
+            return ResponseResult.success(new CustomPage<>(result));
+        } else {
+            List<Platform> list = platformService.list();
+            CustomPage<Platform> customPage = new CustomPage<>(new Page<>());
+            customPage.setRecords(list);
+            customPage.setTotal(list.size());
+            return ResponseResult.success(customPage);
 
+        }
     }
 
     @GetMapping("/download")

--
Gitblit v1.7.1