master
王家东 2 weeks ago
parent c592614fc7
commit 0a38fda4f8
  1. 15
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/cms/controller/CmsHomePageController.java

@ -116,4 +116,19 @@ public class CmsHomePageController /*extends JeecgController<CmsColumn, ICmsColu
}
@ApiOperation(value = "查询全部新闻", notes = "查询全部新闻")
@GetMapping(value = "/cmsfindallnews")
public Result<?> cmsfindallnews(CmsArticle cmsArticle,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CmsArticle> queryWrapper = QueryGenerator.initQueryWrapper(cmsArticle, req.getParameterMap());
queryWrapper.eq("status", "1");
queryWrapper.last("order by publish_time desc");
Page<CmsArticle> page = new Page<CmsArticle>(pageNo, pageSize);
IPage<CmsArticle> pageList = cmsArticleService.page(page, queryWrapper);
return Result.OK(pageList);
}
}

Loading…
Cancel
Save