|
|
@ -3,8 +3,10 @@ package com.inscloudtech.functional.controller; |
|
|
|
/***/ |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.inscloudtech.common.annotation.Log; |
|
|
@ -32,7 +34,7 @@ import java.util.List; |
|
|
|
*/ |
|
|
|
@RestController |
|
|
|
@RequiredArgsConstructor |
|
|
|
@RequestMapping("/functional/info") |
|
|
|
@RequestMapping("/functional/cpuInfo") |
|
|
|
public class CpuInfoController { |
|
|
|
|
|
|
|
private final CpuInfoService cpuInfoService; |
|
|
@ -46,9 +48,11 @@ public class CpuInfoController { |
|
|
|
@GetMapping("/page" ) |
|
|
|
public TableDataInfo<CpuInfo> getCpuInfoPage(PageQuery pageQuery, CpuInfo cpuInfo) { |
|
|
|
Page page = new Page(); |
|
|
|
page.setSize(pageQuery.getPageSize()); |
|
|
|
page.setCurrent(pageQuery.getPageNum()); |
|
|
|
Page result = cpuInfoService.page(page, Wrappers.query(cpuInfo)); |
|
|
|
page.setSize(pageQuery.getPageSize() == null?200:pageQuery.getPageSize()); |
|
|
|
page.setCurrent(pageQuery.getPageNum() == null?1:pageQuery.getPageNum()); |
|
|
|
QueryWrapper<CpuInfo> query = Wrappers.query(cpuInfo); |
|
|
|
query.in(ArrayUtil.isNotEmpty(cpuInfo.getIds()),"id", cpuInfo.getIds()); |
|
|
|
Page result = cpuInfoService.page(page, query); |
|
|
|
TableDataInfo dataInfo = new TableDataInfo(); |
|
|
|
dataInfo.setTotal(result.getTotal()); |
|
|
|
dataInfo.setRows(result.getRecords()); |
|
|
|