wang-hao-jie
2022-01-18 d9da603305a2b94bde78483fa8777a43ee352548
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerReceiveController.java
@@ -49,9 +49,11 @@
    @RequestMapping(value = "/getByPage", method = RequestMethod.GET)
    @ApiOperation(value = "分页获取")
    public Result<IPage<CustomerReceive>> getByPage(PageVo page) {
        IPage<CustomerReceive> data = iCustomerReceiveService.page(PageUtil.initMpPage(page));
    public Result<IPage<CustomerReceive>> getByPage(String name,PageVo page) {
        QueryWrapper<CustomerReceive> wrapper = new QueryWrapper<>();
        if (!StrUtil.isEmpty(name))
            wrapper.like("b.name","%"+name+"%");
        IPage<CustomerReceive> data = iCustomerReceiveService.page2(PageUtil.initMpPage(page),wrapper);
        return new ResultUtil<IPage<CustomerReceive>>().setData(data);
    }
@@ -65,6 +67,17 @@
        return new ResultUtil<CustomerReceive>().setErrorMsg("操作失败");
    }
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ApiOperation(value = "修改头像")
    public Result<CustomerReceive> update(String id,String imgUrl) {
        CustomerReceive customerReceive = iCustomerReceiveService.getById(id);
        customerReceive.setImg(imgUrl);
        if (iCustomerReceiveService.saveOrUpdate(customerReceive)) {
            return new ResultUtil<CustomerReceive>().setData(customerReceive);
        }
        return new ResultUtil<CustomerReceive>().setErrorMsg("操作失败");
    }
    @RequestMapping(value = "/delByIds", method = RequestMethod.POST)
    @ApiOperation(value = "批量通过id删除")
    public Result<Object> delAllByIds(@RequestParam String[] ids) {