病例交流列表 新增了评论排序

This commit is contained in:
2025-07-22 15:55:45 +08:00
parent c5bc0920d3
commit 862df3035c
2 changed files with 29 additions and 1 deletions
@@ -49,9 +49,15 @@ public class getCaseExchangeSearchPage {
@JsonProperty("read_num")
private String readNum; // 阅读量
@JsonProperty("comment_num")
private String commentNum; // 评论数
@JsonProperty("push_date")
private String pushDate; // 发表时间
@JsonProperty("last_comment_time")
private String lastCommentTime; // 最后评论时间
public Map<String, String> toMap() {
Map<String, String> map = new HashMap<>();
if (StringUtils.hasText(createdAt)) {
@@ -62,10 +68,18 @@ public class getCaseExchangeSearchPage {
map.put("a.read_num", readNum);
}
if (StringUtils.hasText(commentNum)) {
map.put("a.comment_num", commentNum);
}
if (StringUtils.hasText(pushDate)) {
map.put("a.push_date", pushDate);
}
if (StringUtils.hasText(lastCommentTime)) {
map.put("commentCreatedAt", lastCommentTime);
}
// 默认排序(如果用户未传递任何排序字段)
if (map.isEmpty()) {
map.put("a.updated_at", "desc");