src/main/java/com/xcong/farmer/cms/conversion/ArticleConversion.java
@@ -21,5 +21,6 @@ @Mapping(source = "authorBelong", target = "company") @Mapping(source = "articleDetails", target = "content") @Mapping(source = "uploadFile", target = "filePath") @Mapping(source = "remark", target = "description") public abstract ArticleData entityToData(ArticleEntity article); } src/main/java/com/xcong/farmer/cms/core/handler/ArticlesDataParserHandler.java
@@ -37,9 +37,7 @@ ArticleEntity article = new ArticleEntity(); Page<ArticleEntity> page = new Page<>(Integer.parseInt(param.getPage()), Integer.parseInt(param.getLimit())); if (StrUtil.isEmpty(param.getColId())) { article.setColumnCode(param.getCode()); } else { List<String> colIdsStr = StrUtil.split(param.getColId(), ','); List<Long> colIds = new ArrayList<>(); @@ -51,6 +49,12 @@ } article.setCompanyId(companyId); if (StrUtil.isNotBlank(param.getType())) { if ("hot".equals(param.getType())) { article.setIsTop(1); } } IPage<ArticleEntity> listPage = articleMapper.selectArticleInPage(page, article); List<ArticleData> list = new ArrayList<>(); src/main/java/com/xcong/farmer/cms/core/tag/data/ArticleData.java
@@ -36,6 +36,8 @@ private String url; private String description; private ArticleData next; private ArticleData prev; @@ -151,4 +153,12 @@ public void setViews(String views) { this.views = views; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } } src/main/java/com/xcong/farmer/cms/core/tag/model/Articles.java
@@ -28,6 +28,11 @@ private String field; /** * hot-热点 */ private String type; public String getColId() { return colId; } @@ -67,4 +72,12 @@ public void setField(String field) { this.field = field; } public String getType() { return type; } public void setType(String type) { this.type = type; } } src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
@@ -303,7 +303,6 @@ return Result.fail("文章不存在"); } articleEntity.setReleaseStatus(ArticleEntity.RELEASE_STATUS_YES); articleEntity.setBeforeColumnId(null); this.baseMapper.updateById(articleEntity); releaseService.releaseArticle(articleEntity.getId(), companyId); src/main/resources/mapper/ArticleMapper.xml
@@ -89,6 +89,9 @@ ${item} </foreach> </if> <if test="record.isTop != null and record.isTop != ''"> and a.is_top=#{record.isTop} </if> </where> order by release_time desc </select>