|
@@ -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.yunzhi.liyuanhui.common.BaseController;
|
7
|
7
|
import com.yunzhi.liyuanhui.common.ResponseBean;
|
|
8
|
+import com.yunzhi.liyuanhui.common.StringUtils;
|
8
|
9
|
import org.slf4j.Logger;
|
9
|
10
|
import org.slf4j.LoggerFactory;
|
10
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -45,11 +46,15 @@ public class TaActivityController extends BaseController {
|
45
|
46
|
@RequestMapping(value="/admin/activity",method= RequestMethod.GET)
|
46
|
47
|
public ResponseBean taActivityList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
47
|
48
|
@RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
48
|
|
- @RequestParam(value ="typeId", required = false) Integer typeId) throws Exception{
|
|
49
|
+ @RequestParam(value ="typeId", required = false) Integer typeId,
|
|
50
|
+ @RequestParam(value ="name", required = false) String name,
|
|
51
|
+ @RequestParam(value ="status", required = false) Integer status) throws Exception{
|
49
|
52
|
|
50
|
53
|
IPage<TaActivity> pg = new Page<>(pageNum, pageSize);
|
51
|
54
|
QueryWrapper<TaActivity> queryWrapper = new QueryWrapper<>();
|
52
|
55
|
queryWrapper.eq(null != typeId, "type_id", typeId);
|
|
56
|
+ queryWrapper.like(!StringUtils.isEmpty(name), "name", name);
|
|
57
|
+ queryWrapper.eq(null != status, "status", status);
|
53
|
58
|
queryWrapper.orderByDesc("weight, create_date");
|
54
|
59
|
|
55
|
60
|
IPage<TaActivity> result = iTaActivityService.page(pg, queryWrapper);
|
|
@@ -92,7 +97,7 @@ public class TaActivityController extends BaseController {
|
92
|
97
|
* @param taActivity 实体对象
|
93
|
98
|
* @return
|
94
|
99
|
*/
|
95
|
|
- @RequestMapping(value="/taActivity/{id}",method= RequestMethod.PUT)
|
|
100
|
+ @RequestMapping(value="/admin/activity/{id}",method= RequestMethod.PUT)
|
96
|
101
|
public ResponseBean taActivityUpdate(@PathVariable Integer id,
|
97
|
102
|
@RequestBody TaActivity taActivity) throws Exception{
|
98
|
103
|
|