18582019636
2024-06-25 e90151755c2b534bd509cf93daa55147d61cb7da
ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/controller/RotateController.java
@@ -3,8 +3,11 @@
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;
@@ -32,6 +35,8 @@
    @Resource
    private RotateService rotateService;
    @Resource
    private RecoveryServeService recoveryServeService;
    /**
     * 轮播图图片分页列表
@@ -48,8 +53,7 @@
    })
    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)));
    }
    /**
@@ -58,7 +62,7 @@
    @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());
    }
    /**
@@ -72,8 +76,17 @@
    @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);
    }
    /**