diff --git a/src/main/java/com/cultural/heritage/model/dto/article/OfficialAccountArticleQueryRequest.java b/src/main/java/com/cultural/heritage/model/dto/article/OfficialAccountArticleQueryRequest.java index 6e6617d..c45b4b9 100644 --- a/src/main/java/com/cultural/heritage/model/dto/article/OfficialAccountArticleQueryRequest.java +++ b/src/main/java/com/cultural/heritage/model/dto/article/OfficialAccountArticleQueryRequest.java @@ -1,6 +1,7 @@ package com.cultural.heritage.model.dto.article; import com.cultural.heritage.common.PageRequest; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -13,6 +14,11 @@ import java.io.Serializable; public class OfficialAccountArticleQueryRequest extends PageRequest implements Serializable { + /** + * 文章标题 + */ + @Schema(description = "文章标题") + private String title; @Serial diff --git a/src/main/java/com/cultural/heritage/service/wx/impl/WeChatOfficialAccountServiceImpl.java b/src/main/java/com/cultural/heritage/service/wx/impl/WeChatOfficialAccountServiceImpl.java index fb5625c..12eda6f 100644 --- a/src/main/java/com/cultural/heritage/service/wx/impl/WeChatOfficialAccountServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/wx/impl/WeChatOfficialAccountServiceImpl.java @@ -40,6 +40,8 @@ public class WeChatOfficialAccountServiceImpl extends ServiceImpl getQueryWrapper(OfficialAccountArticleQueryRequest officialAccountArticleQueryRequest) { QueryWrapper queryWrapper = new QueryWrapper<>(); + String title = officialAccountArticleQueryRequest.getTitle(); + queryWrapper.like(StringUtils.isNotBlank(title), "title", title); String sortField = officialAccountArticleQueryRequest.getSortField(); String sortOrder = officialAccountArticleQueryRequest.getSortOrder(); queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC), sortField);