|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.shigongli.common.BaseController;
|
7
|
7
|
import com.shigongli.common.ResponseBean;
|
|
8
|
+import com.shigongli.constants.StatusConstant;
|
8
|
9
|
import io.swagger.annotations.Api;
|
9
|
10
|
import io.swagger.annotations.ApiOperation;
|
10
|
11
|
import io.swagger.annotations.ApiParam;
|
|
@@ -46,7 +47,7 @@ public class TaHouseController extends BaseController {
|
46
|
47
|
* @param pageSize
|
47
|
48
|
* @return
|
48
|
49
|
*/
|
49
|
|
- @RequestMapping(value="/taHouse",method= RequestMethod.GET)
|
|
50
|
+ @RequestMapping(value="/mp/taHouse",method= RequestMethod.GET)
|
50
|
51
|
@ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
|
51
|
52
|
public ResponseBean taHouseList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
52
|
53
|
@ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
|
|
@@ -64,7 +65,7 @@ public class TaHouseController extends BaseController {
|
64
|
65
|
* @param taHouse 实体对象
|
65
|
66
|
* @return
|
66
|
67
|
*/
|
67
|
|
- @RequestMapping(value="/taHouse",method= RequestMethod.POST)
|
|
68
|
+ @RequestMapping(value="/mp/taHouse",method= RequestMethod.POST)
|
68
|
69
|
@ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
|
69
|
70
|
public ResponseBean taHouseAdd(@ApiParam("保存内容") @RequestBody TaHouse taHouse) throws Exception{
|
70
|
71
|
|
|
@@ -79,14 +80,17 @@ public class TaHouseController extends BaseController {
|
79
|
80
|
* 根据id删除对象
|
80
|
81
|
* @param id 实体ID
|
81
|
82
|
*/
|
82
|
|
- @RequestMapping(value="/taHouse/{id}", method= RequestMethod.DELETE)
|
|
83
|
+ @RequestMapping(value="/mp/taHouse/{id}", method= RequestMethod.DELETE)
|
83
|
84
|
@ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
|
84
|
|
- public ResponseBean taHouseDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
|
85
|
|
- if(iTaHouseService.removeById(id)){
|
86
|
|
- return ResponseBean.success("success");
|
87
|
|
- }else {
|
88
|
|
- return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
|
|
85
|
+ public ResponseBean taHouseDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
|
|
86
|
+ TaHouse taHouse = iTaHouseService.getById(id);
|
|
87
|
+ if (null == taHouse || taHouse.getStatus().equals(StatusConstant.DELETE)) {
|
|
88
|
+ return ResponseBean.success("ok");
|
89
|
89
|
}
|
|
90
|
+
|
|
91
|
+ taHouse.setStatus(StatusConstant.DELETE);
|
|
92
|
+
|
|
93
|
+ return taHouseUpdate(id, taHouse);
|
90
|
94
|
}
|
91
|
95
|
|
92
|
96
|
/**
|
|
@@ -95,9 +99,9 @@ public class TaHouseController extends BaseController {
|
95
|
99
|
* @param taHouse 实体对象
|
96
|
100
|
* @return
|
97
|
101
|
*/
|
98
|
|
- @RequestMapping(value="/taHouse/{id}",method= RequestMethod.PUT)
|
|
102
|
+ @RequestMapping(value="/mp/taHouse/{id}",method= RequestMethod.PUT)
|
99
|
103
|
@ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
|
100
|
|
- public ResponseBean taHouseUpdate(@ApiParam("对象ID") @PathVariable Integer id,
|
|
104
|
+ public ResponseBean taHouseUpdate(@ApiParam("对象ID") @PathVariable String id,
|
101
|
105
|
@ApiParam("更新内容") @RequestBody TaHouse taHouse) throws Exception{
|
102
|
106
|
|
103
|
107
|
if (iTaHouseService.updateById(taHouse)){
|
|
@@ -111,9 +115,9 @@ public class TaHouseController extends BaseController {
|
111
|
115
|
* 根据id查询对象
|
112
|
116
|
* @param id 实体ID
|
113
|
117
|
*/
|
114
|
|
- @RequestMapping(value="/taHouse/{id}",method= RequestMethod.GET)
|
|
118
|
+ @RequestMapping(value="/mp/taHouse/{id}",method= RequestMethod.GET)
|
115
|
119
|
@ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
|
116
|
|
- public ResponseBean taHouseGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
|
|
120
|
+ public ResponseBean taHouseGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
|
117
|
121
|
return ResponseBean.success(iTaHouseService.getById(id));
|
118
|
122
|
}
|
119
|
123
|
}
|