1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package com.ruoyi.project.VRdemo.controller;
- import com.alibaba.fastjson2.JSONObject;
- import com.github.pagehelper.PageInfo;
- import com.ruoyi.framework.aspectj.lang.annotation.Anonymous;
- import com.ruoyi.framework.web.controller.BaseController;
- import com.ruoyi.framework.web.domain.AjaxResult;
- import com.ruoyi.framework.web.page.TableDataInfo;
- import com.ruoyi.project.VRdemo.domain.SearchData;
- import com.ruoyi.project.VRdemo.service.ISearchService;
- import org.apache.poi.ss.formula.functions.T;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- @RestController
- @RequestMapping("/vr/search")
- public class SearchController extends BaseController {
- @Autowired
- private ISearchService searchService;
- // 高级检索功能接口
- @Anonymous
- @PostMapping("/SearchDatabases")
- public TableDataInfo searchDatabases(@RequestBody JSONObject jsonObject) {
- List<SearchData> searchData = jsonObject.getList("searchData", SearchData.class);
- Integer pageNum = jsonObject.getInteger("pageNum");
- Integer pageSize = jsonObject.getInteger("pageSize");
- List<Object> list = searchService.MappingSelection(searchData);
- TableDataInfo rspData = new TableDataInfo();
- rspData.setCode(200);
- rspData.setMsg("查询成功");
- rspData.setRows(searchService.startPage(list, pageNum, pageSize));
- rspData.setTotal(new PageInfo(list).getTotal());
- return rspData;
- }
- }
|