feat: add user leveling and experience system

This commit is contained in:
Tim
2025-07-28 12:34:45 +08:00
parent a5900aa60d
commit 1c2751422d
18 changed files with 167 additions and 10 deletions

View File

@@ -87,6 +87,9 @@ public interface PostRepository extends JpaRepository<Post, Long> {
@Query("SELECT SUM(p.views) FROM Post p WHERE p.author.username = :username AND p.status = com.openisle.model.PostStatus.PUBLISHED")
Long sumViews(@Param("username") String username);
@Query("SELECT COUNT(p) FROM Post p WHERE p.author.username = :username AND p.createdAt >= :start")
long countByAuthorAfter(@Param("username") String username, @Param("start") java.time.LocalDateTime start);
long countByCategory_Id(Long categoryId);
long countDistinctByTags_Id(Long tagId);