hotfix/ 카테고리별 아티클 데이터 퍼오는 로직 롤백
This commit is contained in:
@@ -12,6 +12,7 @@ import myblog.blog.article.application.port.response.ArticleResponseByCategory;
|
||||
import myblog.blog.article.application.port.response.ArticleResponseForCardBox;
|
||||
import myblog.blog.article.application.port.response.ArticleResponseForDetail;
|
||||
import myblog.blog.article.application.port.response.ArticleResponseForEdit;
|
||||
|
||||
import myblog.blog.category.service.CategoryService;
|
||||
import myblog.blog.category.dto.*;
|
||||
import myblog.blog.member.auth.PrincipalDetails;
|
||||
@@ -29,10 +30,8 @@ import org.springframework.ui.Model;
|
||||
import org.springframework.validation.Errors;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -65,21 +65,26 @@ public class ArticleQueries implements ArticleQueriesUseCase {
|
||||
}
|
||||
/*
|
||||
- 카테고리별 게시물 페이징 처리해서 가져오기
|
||||
- tier 1은 super / tier 2는 sub
|
||||
*/
|
||||
@Override
|
||||
public Slice<ArticleResponseForCardBox> getArticlesByCategory(String category, Integer tier, Integer page) {
|
||||
Slice<Article> articles;
|
||||
Slice<Article> articles = null;
|
||||
|
||||
if (tier.equals(0)) {
|
||||
articles = articleRepositoryPort
|
||||
.findByOrderByIdDesc(
|
||||
PageRequest.of(pageResolve(page), 5));
|
||||
}
|
||||
else {
|
||||
if (tier.equals(1)) {
|
||||
articles = articleRepositoryPort
|
||||
.findBySupCategoryOrderByIdDesc(
|
||||
PageRequest.of(pageResolve(page), 5), category);
|
||||
|
||||
}
|
||||
if (tier.equals(2)) {
|
||||
articles = articleRepositoryPort
|
||||
.findBySubCategoryOrderByIdDesc(
|
||||
PageRequest.of(pageResolve(page), 5), category);
|
||||
}
|
||||
|
||||
if(articles == null) throw new IllegalArgumentException("NotFoundArticleException");
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.amazonaws.auth.BasicAWSCredentials;
|
||||
import com.amazonaws.regions.Regions;
|
||||
import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
|
||||
import com.google.gson.Gson;
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
Reference in New Issue
Block a user