长页栏目之页面设置功能

master
rong.liu 2 years ago
parent b9b813c33e
commit af0cde5d5b
  1. 8
      src/main/java/com/huoran/iasf/common/utils/Constant.java
  2. 14
      src/main/java/com/huoran/iasf/controller/SysColumnLongPageController.java
  3. 8
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  4. 3
      src/main/java/com/huoran/iasf/service/SysContentService.java
  5. 16
      src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java

@ -51,4 +51,12 @@ public class Constant {
public static final Integer ARTICLE_PUBLISHED = 1; public static final Integer ARTICLE_PUBLISHED = 1;
public static final Integer ARTICLE_NOT_PUBLISHED = 0; public static final Integer ARTICLE_NOT_PUBLISHED = 0;
/**
* 文章模板状态0禁用1启用
*/
public static final Integer TEMPLATE_STATUS_DISABLED = 0;
public static final Integer TEMPLATE_STATUS_ENABLED = 1;
} }

@ -1,6 +1,8 @@
package com.huoran.iasf.controller; package com.huoran.iasf.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.utils.Constant;
import com.huoran.iasf.vo.req.SysColumnLongRedisVO; import com.huoran.iasf.vo.req.SysColumnLongRedisVO;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -50,6 +52,18 @@ public class SysColumnLongPageController {
} }
@PostMapping("/getLongPageInformation")
@ApiOperation(value = "根据栏目id查询类型长页栏目信息", response = SysColumnLongPage.class)
public R getLongPageInformation(@ApiParam(name = "columnId", value = "栏目id", required = true) @RequestParam Integer columnId) {
QueryWrapper<SysColumnLongPage> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column_id",columnId);
List<SysColumnLongPage> longPageList = service.list(queryWrapper);
return R.success(longPageList);
}
@PostMapping("/save") @PostMapping("/save")
@ApiOperation(value = "新增", response = SysColumnLongPage.class) @ApiOperation(value = "新增", response = SysColumnLongPage.class)
public R save(@RequestBody @Valid @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) { public R save(@RequestBody @Valid @ApiParam(name = "长页栏目拓展表对象", value = "传入json格式", required = true) SysColumnLongPage sysColumnLongPage) {

@ -82,5 +82,13 @@ public class SysContentController {
public R newlyPublishedArticles(@RequestBody @Valid PageContentReqVO content) { public R newlyPublishedArticles(@RequestBody @Valid PageContentReqVO content) {
return service.newlyPublishedArticles(content); return service.newlyPublishedArticles(content);
} }
/*查询已发布的、启用了的文章列表接口*/
@PostMapping("/publishedEnabledArticles")
@ApiOperation(value = "查询已发布的、启用了的文章列表", response = PageContentReqVO.class)
public R publishedEnabledArticles() {
return service.publishedEnabledArticles();
}
} }

@ -19,4 +19,7 @@ public interface SysContentService extends IService<SysContent> {
//站点最新发布的文章 //站点最新发布的文章
R newlyPublishedArticles(PageContentReqVO reqVO); R newlyPublishedArticles(PageContentReqVO reqVO);
//查询已发布的、启用了的文章列表
R publishedEnabledArticles();
} }

@ -15,6 +15,8 @@ import com.huoran.iasf.vo.resp.PageContentRespVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/** /**
* @描述文章管理 服务类 * @描述文章管理 服务类
* @作者: Rong * @作者: Rong
@ -63,6 +65,20 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
IPage<SysContent> pageList = baseMapper.selectPage(page, queryWrapper); IPage<SysContent> pageList = baseMapper.selectPage(page, queryWrapper);
return R.success(pageList); return R.success(pageList);
} }
@Override
public R publishedEnabledArticles() {
//查询已发布的、启用了的文章列表接
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_release", Constant.ARTICLE_PUBLISHED);
queryWrapper.eq("template_status",Constant.TEMPLATE_STATUS_ENABLED);
// queryWrapper.eq("site_id", content.getSiteId());
List<SysContent> sysContentList = mapper.selectList(queryWrapper);
return R.success(sysContentList);
}
} }

Loading…
Cancel
Save