| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.RecoveryServe; |
| | | import com.ruoyi.admin.entity.Rotate; |
| | | import com.ruoyi.admin.service.RecoveryServeService; |
| | | import com.ruoyi.admin.service.RotateService; |
| | | import com.ruoyi.admin.vo.RotateResultVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | @Resource |
| | | private RotateService rotateService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | |
| | | /** |
| | | * 轮播图图片分页列表 |
| | |
| | | * @param pageSize 每页显示条数 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @ApiOperation(value = "轮播图分页查询列表", tags = {"后台-系统设置-轮播图管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | }) |
| | | public R<IPage<Rotate>> queryPageList(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(rotateService.lambdaQuery().eq(Rotate::getIsDelete, 0) |
| | | .orderByDesc(Rotate::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | | return R.ok(rotateService.queryPage(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | | * 轮播图列表 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @GetMapping(value = "/bannerList") |
| | | public R<List<Rotate>> bannerList() { |
| | | return R.ok(rotateService.lambdaQuery().eq(Rotate::getIsDelete, 0) |
| | | .orderByAsc(Rotate::getOrder).list()); |
| | | .orderByAsc(Rotate::getSort).list()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param id 轮播图id |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @ApiOperation(value = "轮播图详情", tags = {"后台-系统设置-轮播图管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "轮播图id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Rotate> detail(@RequestParam Integer id) { |
| | | return R.ok(rotateService.getById(id)); |
| | | public R<RotateResultVO> detail(@RequestParam Integer id) { |
| | | RotateResultVO rotateResultVO = new RotateResultVO(); |
| | | Rotate rotate = rotateService.getById(id); |
| | | rotateResultVO.setRotate(rotate); |
| | | if (null != rotate.getRotateServeId()) { |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, rotate.getRotateServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | rotateResultVO.setRecoveryServe(recoveryServe); |
| | | } |
| | | return R.ok(rotateResultVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param rotate 轮播图信息 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @ApiOperation(value = "新增轮播图", tags = {"后台-系统设置-轮播图管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Rotate rotate) { |
| | |
| | | * @param rotate 轮播图信息 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @ApiOperation(value = "修改轮播图", tags = {"后台-系统设置-轮播图管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody Rotate rotate) { |
| | |
| | | * @param ids 轮播图多条id拼接 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @ApiOperation(value = "批量删除轮播图", tags = {"后台-系统设置-轮播图管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |