mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-05 08:57:12 +08:00
优化:优化模型类命名(为数据模型类添加 DO 后缀),并优化所有模型相关变量命名
This commit is contained in:
@@ -29,7 +29,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageInfo;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.model.vo.R;
|
||||
|
||||
/**
|
||||
@@ -67,9 +67,9 @@ public abstract class BaseController<S extends BaseService<V, D, Q, C, U>, V, D,
|
||||
*/
|
||||
@Operation(summary = "分页查询列表")
|
||||
@GetMapping
|
||||
protected R<PageInfo<V>> page(@Validated Q query, @Validated PageQuery pageQuery) {
|
||||
PageInfo<V> pageInfo = baseService.page(query, pageQuery);
|
||||
return R.ok(pageInfo);
|
||||
protected R<PageDataVO<V>> page(@Validated Q query, @Validated PageQuery pageQuery) {
|
||||
PageDataVO<V> pageDataVO = baseService.page(query, pageQuery);
|
||||
return R.ok(pageDataVO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageInfo;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
|
||||
/**
|
||||
* 业务接口基类
|
||||
@@ -49,8 +49,8 @@ public interface BaseService<V, D, Q, C, U> {
|
||||
* 分页查询条件
|
||||
* @return 分页列表信息
|
||||
*/
|
||||
default PageInfo<V> page(Q query, PageQuery pageQuery) {
|
||||
return new PageInfo<>();
|
||||
default PageDataVO<V> page(Q query, PageQuery pageQuery) {
|
||||
return new PageDataVO<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.baomidou.mybatisplus.core.toolkit.ReflectionKit;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageInfo;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
import top.charles7c.cnadmin.common.util.helper.QueryHelper;
|
||||
import top.charles7c.cnadmin.common.util.validate.CheckUtils;
|
||||
|
||||
@@ -53,10 +53,10 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T, V, D, Q, C, U>
|
||||
protected Class<D> detailVoClass = currentDetailVoClass();
|
||||
|
||||
@Override
|
||||
public PageInfo<V> page(Q query, PageQuery pageQuery) {
|
||||
public PageDataVO<V> page(Q query, PageQuery pageQuery) {
|
||||
QueryWrapper<T> queryWrapper = QueryHelper.build(query);
|
||||
IPage<T> page = baseMapper.selectPage(pageQuery.toPage(), queryWrapper);
|
||||
return PageInfo.build(page, voClass);
|
||||
return PageDataVO.build(page, voClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user