From edf3f59f47c3053720f954d083a7485e334d3222 Mon Sep 17 00:00:00 2001 From: Gary Date: Tue, 30 Jan 2024 15:17:53 +0800 Subject: [PATCH] 1.enable top10 check when without token or expired --- luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java | 3 +++ .../src/main/java/com/luoo/music/service/JournalService.java | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java b/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java index 9bac3a9..918a6aa 100644 --- a/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java +++ b/luoo_music/src/main/java/com/luoo/music/dao/JournalDao.java @@ -42,5 +42,8 @@ public interface JournalDao extends JpaRepository,JpaSpecificati @Query(value = "select * from tb_journal where id in ?1 order by field(id,?1)", nativeQuery = true) List orderByField(List objectIds); + + @Query(value = "select 1 from tb_journal where ?1 in (select journal_no_tmp.journal_no from (select * from tb_journal order by ABS(journal_no) desc limit 10) as journal_no_tmp) limit 1", nativeQuery = true) + Integer isLatest10(String journalNo); } diff --git a/luoo_music/src/main/java/com/luoo/music/service/JournalService.java b/luoo_music/src/main/java/com/luoo/music/service/JournalService.java index c34bb89..3630314 100644 --- a/luoo_music/src/main/java/com/luoo/music/service/JournalService.java +++ b/luoo_music/src/main/java/com/luoo/music/service/JournalService.java @@ -171,12 +171,10 @@ public class JournalService { } - public boolean isLatest10(String journalNo) { - return true; + return null!=journalDao.isLatest10(journalNo); } - public List orderByField(List objectIds) { return journalDao.orderByField(objectIds); }