| | |
| | | |
| | | 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 io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @Resource |
| | | private RotateService rotateService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | |
| | | /** |
| | | * 轮播图图片分页列表 |
| | |
| | | }) |
| | | 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))); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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); |
| | | } |
| | | |
| | | /** |