1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.isoft91.gonn.gps.business.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft91.gonn.gps.business.dto.BaseStationInfoDto;
import com.isoft91.gonn.gps.business.service.IBaseStationInfoService;
import com.isoft91.gonn.gps.business.service.IComputerRoomInfoService;
import com.isoft91.gonn.gps.utils.Result.Ret;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author jiangpengpeng
* @since 2021-04-02
*/
@RestController
@RequestMapping("/base-station-info")
public class BaseStationInfoController {
@Autowired
private IBaseStationInfoService iBaseStationInfoService;
/**
* 新分页查询2.0
*/
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@PostMapping("/pages")
@ApiOperation(value = "分页查询项目", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页", required = true),
@ApiImplicitParam(name = "size", value = "页大小", required = true)})
public Ret selectPages(BaseStationInfoDto searchDto, Integer page, Integer size) {
if (page == null && size == null) {
return Ret.error().setMsg("当前页和页大小不能为空");
}
IPage iPage = iBaseStationInfoService.selectPages(searchDto, new Page(page, size));
return Ret.ok().setData(iPage);
}
}