11.6 save

This commit is contained in:
kms
2022-11-06 18:59:49 +09:00
parent e4e2574577
commit 65719df6b2
5 changed files with 5 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ public class ArticleController {
@GetMapping()
public List<ArticleResponse> getArticles(@AuthenticationPrincipal UserAuth userAuth, @ModelAttribute ArticleParam articleParam) {
return articleService.getArticles(articleParam);
return articleService.getArticles(userAuth, articleParam);
}
@GetMapping("/{slug}")

View File

@@ -10,7 +10,7 @@ import java.util.List;
public interface ArticleService {
List<ArticleResponse> getArticles(ArticleParam articleParam);
List<ArticleResponse> getArticles(UserAuth userAuth, ArticleParam articleParam);
ArticleResponse getArticle(UserAuth userAuth, String slug);

View File

@@ -44,7 +44,7 @@ public class ArticleServiceImpl implements ArticleService {
private final FavoriteRepository favoriteRepository;
@Override
public List<ArticleResponse> getArticles(ArticleParam articleParam){
public List<ArticleResponse> getArticles(UserAuth userAuth, ArticleParam articleParam){
Pageable pageable = null;
List<Article> articles = null;

View File

@@ -10,6 +10,7 @@ import com.io.realworld.domain.aggregate.user.service.UserServiceImpl;
import lombok.AllArgsConstructor;
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

View File

@@ -70,6 +70,7 @@ class CommentRepositoryTest {
articleRepository.save(article);
}
@Test
@DisplayName("댓글 추가 테스트")
void addComment(){