From 382a0fc3c11cd2ef3e968b088db0b58cd3ebdb77 Mon Sep 17 00:00:00 2001 From: wangqing <408564126@qq.com> Date: Mon, 29 Jan 2024 17:54:14 +0800 Subject: [PATCH] fix cms journal error --- .../main/java/com/luoo/music/service/CMSJournalService.java | 5 ++++- luoo_tag/src/main/java/com/luoo/tag/service/TagService.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java b/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java index c9747b9..44d1dfd 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/CMSJournalService.java @@ -78,7 +78,9 @@ public class CMSJournalService { Specification journalSpecification = buildSearchSpecification(param, journalIdsByTags); journalPage = journalDao.findAll(journalSpecification, pageRequest); } else { - journalPage = journalDao.findAll(pageRequest); + List journalIdsByTags = null; + Specification journalSpecification = buildSearchSpecification(param, journalIdsByTags); + journalPage = journalDao.findAll(journalSpecification,pageRequest); } long totalElements = journalPage.getTotalElements(); List content = journalPage.getContent(); @@ -145,6 +147,7 @@ public class CMSJournalService { Predicate title = builder.like(root.get("title"), likeExpression); predicateList.add(builder.or(journalNo, title)); } + query.orderBy(builder.desc(root.get("journalNo").as(Integer.class))); return builder.and(predicateList.toArray(new Predicate[predicateList.size()])); }; } diff --git a/luoo_tag/src/main/java/com/luoo/tag/service/TagService.java b/luoo_tag/src/main/java/com/luoo/tag/service/TagService.java index c377df9..0ecee82 100644 --- a/luoo_tag/src/main/java/com/luoo/tag/service/TagService.java +++ b/luoo_tag/src/main/java/com/luoo/tag/service/TagService.java @@ -217,8 +217,8 @@ public class TagService { if(resultCode == 0){ return userInfoResult.getData(); }*/ - UserInfo foo = UserInfo.builder().id("1627863701048659968").name("foo").build(); - UserInfo other = UserInfo.builder().id("1627863701048659969").name("老左").build(); + UserInfo foo = UserInfo.builder().id("1627863701048659968").name("落在低处").build(); + UserInfo other = UserInfo.builder().id("1627863701048659969").name("左岸以西").build(); return Lists.newArrayList(foo, other); }