|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.shigongli.common.BaseController;
|
7
|
7
|
import com.shigongli.common.ResponseBean;
|
8
|
8
|
import com.shigongli.constants.StatusConstant;
|
|
9
|
+import com.shigongli.entity.TaPerson;
|
9
|
10
|
import io.swagger.annotations.Api;
|
10
|
11
|
import io.swagger.annotations.ApiOperation;
|
11
|
12
|
import io.swagger.annotations.ApiParam;
|
|
@@ -21,6 +22,8 @@ import com.shigongli.service.ITaHouseService;
|
21
|
22
|
import com.shigongli.entity.TaHouse;
|
22
|
23
|
import org.springframework.web.bind.annotation.RestController;
|
23
|
24
|
|
|
25
|
+import javax.servlet.http.HttpServletRequest;
|
|
26
|
+
|
24
|
27
|
/**
|
25
|
28
|
* <p>
|
26
|
29
|
* 房源 前端控制器
|
|
@@ -54,12 +57,36 @@ public class TaHouseController extends BaseController {
|
54
|
57
|
|
55
|
58
|
IPage<TaHouse> pg = new Page<>(pageNum, pageSize);
|
56
|
59
|
QueryWrapper<TaHouse> queryWrapper = new QueryWrapper<>();
|
|
60
|
+ queryWrapper.eq("status", StatusConstant.NORMAL);
|
57
|
61
|
queryWrapper.orderByDesc("create_date");
|
58
|
62
|
|
59
|
63
|
IPage<TaHouse> result = iTaHouseService.page(pg, queryWrapper);
|
60
|
64
|
return ResponseBean.success(result);
|
61
|
65
|
}
|
62
|
66
|
|
|
67
|
+ /**
|
|
68
|
+ * 分页查询列表
|
|
69
|
+ * @param pageNum
|
|
70
|
+ * @param pageSize
|
|
71
|
+ * @return
|
|
72
|
+ */
|
|
73
|
+ @RequestMapping(value="/ma/taHouse",method= RequestMethod.GET)
|
|
74
|
+ @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
|
|
75
|
+ public ResponseBean houseList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
|
76
|
+ @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
77
|
+ HttpServletRequest request) throws Exception{
|
|
78
|
+
|
|
79
|
+ TaPerson taPerson = getPerson(request);
|
|
80
|
+ if (null == taPerson) {
|
|
81
|
+ return ResponseBean.error("数据错误, 校验当前人员出错", ResponseBean.ERROR_UNAVAILABLE);
|
|
82
|
+ }
|
|
83
|
+
|
|
84
|
+ IPage<TaHouse> pg = new Page<>(pageNum, pageSize);
|
|
85
|
+ IPage<TaHouse> result = iTaHouseService.getHousesOfKeeper(pg, taPerson);
|
|
86
|
+ return ResponseBean.success(result);
|
|
87
|
+ }
|
|
88
|
+
|
|
89
|
+
|
63
|
90
|
/**
|
64
|
91
|
* 保存对象
|
65
|
92
|
* @param taHouse 实体对象
|