| | |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getIsDelete, 0) |
| | | .orderByDesc(RecoveryClassify::getSupClassify) |
| | | .orderByAsc(RecoveryClassify::getSort) |
| | | .orderByDesc(RecoveryClassify::getCreateTime) |
| | | .page(Page.of(pageNum, pageSize))); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 是否首页推荐 |
| | | */ |
| | | @ApiOperation(value = "是否首页推荐", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/recommend") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分类id", name = "id", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "是否推荐 0未推荐;1已推荐", name = "recommend", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> recommend(@RequestParam Integer id, @RequestParam Integer recommend) { |
| | | Integer[] arr = {0, 1}; |
| | | boolean contains = Arrays.stream(arr).collect(Collectors.toList()).contains(recommend); |
| | | if (!contains) { |
| | | return R.fail("推荐状态异常!"); |
| | | } |
| | | return recoveryClassifyService.lambdaUpdate().set(RecoveryClassify::getIsRecommend, recommend) |
| | | .eq(RecoveryClassify::getId, id).update() ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 新增回收分类 |
| | | * |
| | | * @param recoveryClassify 回收分类信息 |