Add count and description to category and tag dropdown

This commit is contained in:
Tim
2025-07-10 11:51:04 +08:00
parent bdbc7e72b7
commit a9cffc6e42
8 changed files with 139 additions and 38 deletions

View File

@@ -274,4 +274,12 @@ public class PostService {
public java.util.List<Post> getPostsByIds(java.util.List<Long> ids) {
return postRepository.findAllById(ids);
}
public long countPostsByCategory(Long categoryId) {
return postRepository.countByCategory_Id(categoryId);
}
public long countPostsByTag(Long tagId) {
return postRepository.countDistinctByTags_Id(tagId);
}
}