Commit 76d55aaa authored by hezhen's avatar hezhen

Merge branch 'dev-chw' of http://113.105.137.151:22280/youjj/cloud-platform into dev-chw

parents 100ce890 0e87c96b
...@@ -32,17 +32,17 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -32,17 +32,17 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
private final Integer HOME_PAGE_NUMBER = 4; private final Integer HOME_PAGE_NUMBER = 4;
/** /**
* 文章列表 * 资讯列表
*
* @param page * @param page
* @param limit * @param limit
* @param type * @param type
* @param title
* @param typeId
* @param flag 是否过滤未启用数据
* @return * @return
*/ */
public PageInfo getArticleList(Integer page, Integer limit, Integer type,String title, Integer typeId) { public PageInfo getArticleList(Integer page, Integer limit, Integer type,String title, Integer typeId, boolean flag) {
PageHelper.startPage(page, limit); PageHelper.startPage(page, limit);
Example example = new Example(Article.class); Example example = new Example(Article.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
...@@ -56,7 +56,9 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> { ...@@ -56,7 +56,9 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
criteria.andEqualTo("typeId", typeId); criteria.andEqualTo("typeId", typeId);
} }
criteria.andEqualTo("isDel", 0); criteria.andEqualTo("isDel", 0);
if (flag) {
criteria.andEqualTo("status", 1); criteria.andEqualTo("status", 1);
}
example.orderBy("weight").asc(); example.orderBy("weight").asc();
return PageInfo.of(mapper.selectByExample(example)); return PageInfo.of(mapper.selectByExample(example));
} }
......
...@@ -28,7 +28,7 @@ public class ArticleController extends BaseController<ArticleBiz, Article> { ...@@ -28,7 +28,7 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
@RequestParam(name = "type", defaultValue = "1") Integer type, @RequestParam(name = "type", defaultValue = "1") Integer type,
@RequestParam(value = "title",required = false) String title, @RequestParam(value = "title",required = false) String title,
@RequestParam(value = "typeId",required = false) Integer typeId) { @RequestParam(value = "typeId",required = false) Integer typeId) {
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title, typeId)); return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title, typeId, true));
} }
@GetMapping("/app/unauth/one") @GetMapping("/app/unauth/one")
......
...@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = {"文章"}) @Api(tags = {"文章"})
public class ArticleAdminController extends BaseController<ArticleBiz, Article> { public class ArticleAdminController extends BaseController<ArticleBiz, Article> {
@GetMapping("/list") @GetMapping("list")
@ApiOperation(value = "获取文章列表") @ApiOperation(value = "获取文章列表")
public ObjectRestResponse getArticleList( public ObjectRestResponse getArticleList(
@RequestParam(name = "page", defaultValue = "1") Integer page, @RequestParam(name = "page", defaultValue = "1") Integer page,
...@@ -28,7 +28,7 @@ public class ArticleAdminController extends BaseController<ArticleBiz, Article> ...@@ -28,7 +28,7 @@ public class ArticleAdminController extends BaseController<ArticleBiz, Article>
@RequestParam(name = "type", defaultValue = "1") Integer type, @RequestParam(name = "type", defaultValue = "1") Integer type,
@RequestParam(value = "title",required = false) String title, @RequestParam(value = "title",required = false) String title,
@RequestParam(value = "typeId",required = false) Integer typeId) { @RequestParam(value = "typeId",required = false) Integer typeId) {
return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title, typeId)); return ObjectRestResponse.succ(baseBiz.getArticleList(page, limit, type,title, typeId, false));
} }
@GetMapping("/app/unauth/one") @GetMapping("/app/unauth/one")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment