|
@@ -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,17 +47,18 @@ public class TaMateTagGroupController extends BaseController {
|
46
|
47
|
* @param pageSize
|
47
|
48
|
* @return
|
48
|
49
|
*/
|
49
|
|
- @RequestMapping(value="/taMateTagGroup",method= RequestMethod.GET)
|
|
50
|
+ @RequestMapping(value="/mp/taMateTagGroup",method= RequestMethod.GET)
|
50
|
51
|
@ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
|
51
|
52
|
public ResponseBean taMateTagGroupList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
52
|
53
|
@ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
|
53
|
54
|
|
54
|
|
- IPage<TaMateTagGroup> pg = new Page<>(pageNum, pageSize);
|
55
|
|
- QueryWrapper<TaMateTagGroup> queryWrapper = new QueryWrapper<>();
|
56
|
|
- queryWrapper.orderByDesc("create_date");
|
|
55
|
+ IPage<TaMateTagGroup> pg = new Page<>(pageNum, pageSize);
|
|
56
|
+ QueryWrapper<TaMateTagGroup> queryWrapper = new QueryWrapper<>();
|
|
57
|
+ queryWrapper.eq("status", StatusConstant.NORMAL);
|
|
58
|
+ queryWrapper.orderByDesc("create_date");
|
57
|
59
|
|
58
|
|
- IPage<TaMateTagGroup> result = iTaMateTagGroupService.page(pg, queryWrapper);
|
59
|
|
- return ResponseBean.success(result);
|
|
60
|
+ IPage<TaMateTagGroup> result = iTaMateTagGroupService.page(pg, queryWrapper);
|
|
61
|
+ return ResponseBean.success(result);
|
60
|
62
|
}
|
61
|
63
|
|
62
|
64
|
/**
|
|
@@ -64,7 +66,7 @@ public class TaMateTagGroupController extends BaseController {
|
64
|
66
|
* @param taMateTagGroup 实体对象
|
65
|
67
|
* @return
|
66
|
68
|
*/
|
67
|
|
- @RequestMapping(value="/taMateTagGroup",method= RequestMethod.POST)
|
|
69
|
+ @RequestMapping(value="/mp/taMateTagGroup",method= RequestMethod.POST)
|
68
|
70
|
@ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
|
69
|
71
|
public ResponseBean taMateTagGroupAdd(@ApiParam("保存内容") @RequestBody TaMateTagGroup taMateTagGroup) throws Exception{
|
70
|
72
|
|
|
@@ -79,14 +81,16 @@ public class TaMateTagGroupController extends BaseController {
|
79
|
81
|
* 根据id删除对象
|
80
|
82
|
* @param id 实体ID
|
81
|
83
|
*/
|
82
|
|
- @RequestMapping(value="/taMateTagGroup/{id}", method= RequestMethod.DELETE)
|
|
84
|
+ @RequestMapping(value="/mp/taMateTagGroup/{id}", method= RequestMethod.DELETE)
|
83
|
85
|
@ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
|
84
|
|
- public ResponseBean taMateTagGroupDelete(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
|
85
|
|
- if(iTaMateTagGroupService.removeById(id)){
|
86
|
|
- return ResponseBean.success("success");
|
87
|
|
- }else {
|
88
|
|
- return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
|
|
86
|
+ public ResponseBean taMateTagGroupDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
|
|
87
|
+ TaMateTagGroup taMateTagGroup = iTaMateTagGroupService.getById(id);
|
|
88
|
+ if (null == taMateTagGroup || taMateTagGroup.getStatus().equals(StatusConstant.DELETE)) {
|
|
89
|
+ return ResponseBean.success("ok");
|
89
|
90
|
}
|
|
91
|
+
|
|
92
|
+ taMateTagGroup.setStatus(StatusConstant.DELETE);
|
|
93
|
+ return taMateTagGroupUpdate(id, taMateTagGroup);
|
90
|
94
|
}
|
91
|
95
|
|
92
|
96
|
/**
|
|
@@ -95,9 +99,9 @@ public class TaMateTagGroupController extends BaseController {
|
95
|
99
|
* @param taMateTagGroup 实体对象
|
96
|
100
|
* @return
|
97
|
101
|
*/
|
98
|
|
- @RequestMapping(value="/taMateTagGroup/{id}",method= RequestMethod.PUT)
|
|
102
|
+ @RequestMapping(value="/mp/taMateTagGroup/{id}",method= RequestMethod.PUT)
|
99
|
103
|
@ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
|
100
|
|
- public ResponseBean taMateTagGroupUpdate(@ApiParam("对象ID") @PathVariable Integer id,
|
|
104
|
+ public ResponseBean taMateTagGroupUpdate(@ApiParam("对象ID") @PathVariable String id,
|
101
|
105
|
@ApiParam("更新内容") @RequestBody TaMateTagGroup taMateTagGroup) throws Exception{
|
102
|
106
|
|
103
|
107
|
if (iTaMateTagGroupService.updateById(taMateTagGroup)){
|
|
@@ -111,9 +115,9 @@ public class TaMateTagGroupController extends BaseController {
|
111
|
115
|
* 根据id查询对象
|
112
|
116
|
* @param id 实体ID
|
113
|
117
|
*/
|
114
|
|
- @RequestMapping(value="/taMateTagGroup/{id}",method= RequestMethod.GET)
|
|
118
|
+ @RequestMapping(value="/mp/taMateTagGroup/{id}",method= RequestMethod.GET)
|
115
|
119
|
@ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
|
116
|
|
- public ResponseBean taMateTagGroupGet(@ApiParam("对象ID") @PathVariable Integer id) throws Exception{
|
|
120
|
+ public ResponseBean taMateTagGroupGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
|
117
|
121
|
return ResponseBean.success(iTaMateTagGroupService.getById(id));
|
118
|
122
|
}
|
119
|
123
|
}
|