feat(web): 新增博客首页文章、分类、标签及博客设置相关接口
- 新增ArticleController提供首页文章分页查询接口 - 实现ArticleService及其实现类,支持分页查询文章及其分类标签关联信息 - 扩展ArticleCategoryRelRepository和ArticleTagRelRepository,支持批量查询文章关联分类和标签 - 新增CategoryController及CategoryService,实现前台分类列表查询接口 - 新增TagController及TagService,实现前台标签列表查询接口 - 新增BlogSettingsController及BlogSettingsService,支持博客配置信息查询 - 添加相应的请求响应VO,包含文章、分类、标签及博客设置数据结构 - 移除无用的User模型代码,简化项目结构
This commit is contained in:
@@ -17,4 +17,6 @@ public interface ArticleCategoryRelRepository extends JpaRepository<ArticleCateg
|
||||
ArticleCategoryRel findByArticleId(Long articleId);
|
||||
|
||||
List<ArticleCategoryRel> findByCategoryId(Long categoryId);
|
||||
|
||||
List<ArticleCategoryRel> findByArticleIdIn(List<Long> articleIds);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface ArticleTagRelRepository extends JpaRepository<ArticleTagRel, Long> {
|
||||
@@ -16,4 +17,6 @@ public interface ArticleTagRelRepository extends JpaRepository<ArticleTagRel, Lo
|
||||
List<ArticleTagRel> findByArticleId(Long articleId);
|
||||
|
||||
List<ArticleTagRel> findByTagId(Long tagId);
|
||||
|
||||
List<ArticleTagRel> findByArticleIdIn(Collection<Long> articleIds);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,13 @@ import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface CategoryRepository extends JpaRepository<Category, Long>, JpaSpecificationExecutor<Category> {
|
||||
boolean existsCategoryByName(String name);
|
||||
|
||||
Page<Category> findAll(Specification<Category> specification, Pageable pageable);
|
||||
|
||||
List<Category> findAllByIdIn(Collection<Long> ids);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user