From 2b8232fb1f4c30e2c7bec3b96bc71cb4b3b8abd4 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Sat, 22 Mar 2025 23:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0https?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/article/OfficialAccountArticleQueryRequest.java | 6 ++++++ .../service/wx/impl/WeChatOfficialAccountServiceImpl.java | 2 ++ 2 files changed, 8 insertions(+) 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);