feat: 完成记录功能开发
- 添加保存记录API到RecordController - 修复DeductRecordRepository的HQL语法错误 - 更新前端api.js添加记录API - 更新八字结果页面保存测算记录 - 完善记录列表页面显示历史记录
This commit is contained in:
1 parent
683f55e4ca
commit
91a14ca6d1
10 files changed
+280
-127
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package xuan.repository;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
@@ -15,6 +16,6 @@ public interface DeductRecordRepository extends JpaRepository<DeductRecord, Long
|
||||
|
||||
List<DeductRecord> findByUserIdAndTypeOrderByCreateTimeDesc(String userId, String type);
|
||||
|
||||
@Query("SELECT d FROM DeductRecord d WHERE d.userId = :userId ORDER BY d.createTime DESC LIMIT 10")
|
||||
List<DeductRecord> findTop10ByUserIdOrderByCreateTimeDesc(@Param("userId") String userId);
|
||||
@Query("SELECT d FROM DeductRecord d WHERE d.userId = :userId ORDER BY d.createTime DESC")
|
||||
List<DeductRecord> findTop10ByUserIdOrderByCreateTimeDesc(@Param("userId") String userId, Pageable pageable);
|
||||
}
|
||||
Reference in new issue
Block a user