新增分页对象,是doc文档返回对应的文档注释

This commit is contained in:
LionCity
2020-08-31 11:02:58 +08:00
parent 8a13035675
commit a6970e4a89
6 changed files with 60 additions and 11 deletions

View File

@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import co.yixiang.domain.PageResult;
/**
* @author ${author}
* @date ${date}
@ -51,7 +51,7 @@ public class ${className}Controller {
@Log("查询${apiAlias}")
@ApiOperation("查询${apiAlias}")
@PreAuthorize("@el.check('admin','${changeClassName}:list')")
public ResponseEntity<Object> get${className}s(${className}QueryCriteria criteria, Pageable pageable){
public ResponseEntity<PageResult<${className}Dto>> get${className}s(${className}QueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK);
}

View File

@ -52,7 +52,7 @@ import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import co.yixiang.base.PageResult;
/**
* @author ${author}
* @date ${date}
@ -67,13 +67,10 @@ public class ${className}ServiceImpl extends BaseServiceImpl<${className}Mapper,
@Override
//@Cacheable
public Map<String, Object> queryAll(${className}QueryCriteria criteria, Pageable pageable) {
public PageResult<${className}Dto> queryAll(${className}QueryCriteria criteria, Pageable pageable) {
getPage(pageable);
PageInfo<${className}> page = new PageInfo<>(queryAll(criteria));
Map<String, Object> map = new LinkedHashMap<>(2);
map.put("content", generator.convert(page.getList(), ${className}Dto.class));
map.put("totalElements", page.getTotal());
return map;
return generator.convertPageInfo(page,${className}VO.class);
}

View File

@ -16,20 +16,20 @@ import java.util.Map;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import co.yixiang.base.PageResult;
/**
* @author ${author}
* @date ${date}
*/
public interface ${className}Service extends BaseService<${className}>{
/**
/**
* 查询数据分页
* @param criteria 条件
* @param pageable 分页参数
* @return Map<String,Object>
*/
Map<String,Object> queryAll(${className}QueryCriteria criteria, Pageable pageable);
PageResult<${className}Dto> queryAll(${className}QueryCriteria criteria, Pageable pageable);
/**
* 查询所有数据不分页