huliguo
2 天以前 6d794867f4255811ad990224b7ca25f6efcf77a0
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;
@@ -103,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")
@@ -189,7 +197,7 @@
                platformService.saveBatch(platforms);
                return ResponseResult.success("成功导入" + platforms.size() + "条数据");
            } else {
                return ResponseResult.error("没有有效数据可导入");
                return ResponseResult.success();
            }
        } catch (Exception e) {