21.12.05 리팩토링중
This commit is contained in:
@@ -23,6 +23,7 @@ import org.modelmapper.ModelMapper;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Slice;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -54,7 +55,7 @@ public class ArticleController {
|
||||
categoryService
|
||||
.findCategoryByTier(2)
|
||||
.stream()
|
||||
.map(c -> modelMapper.map(c, CategoryNormalDto.class))
|
||||
.map(category -> modelMapper.map(category, CategoryNormalDto.class))
|
||||
.collect(Collectors.toList());
|
||||
model.addAttribute("categoryInput", categoryForInput);
|
||||
|
||||
@@ -62,7 +63,7 @@ public class ArticleController {
|
||||
tagsService
|
||||
.findAllTags()
|
||||
.stream()
|
||||
.map(c -> new TagsDto(c.getName()))
|
||||
.map(tag -> new TagsDto(tag.getName()))
|
||||
.collect(Collectors.toList());
|
||||
model.addAttribute("tagsInput", tagsForInput);
|
||||
|
||||
@@ -81,13 +82,15 @@ public class ArticleController {
|
||||
return "article/articleWriteForm";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
- 넘어온 articleForm을 저장
|
||||
*/
|
||||
@PostMapping("article/write")
|
||||
@Transactional
|
||||
public String writeArticle(@ModelAttribute ArticleForm articleForm, Authentication authentication) {
|
||||
public String writeArticle(ArticleForm articleForm, @AuthenticationPrincipal PrincipalDetails principal) {
|
||||
|
||||
PrincipalDetails principal = (PrincipalDetails) authentication.getPrincipal();
|
||||
articleForm.setMemberId(principal.getMemberId());
|
||||
Article article = articleService.writeArticle(articleForm);
|
||||
Article article = articleService.writeArticle(articleForm, principal.getMember());
|
||||
|
||||
// articleService.pushArticleToGithub(article);
|
||||
tempArticleService.deleteTemp();
|
||||
@@ -311,10 +314,8 @@ public class ArticleController {
|
||||
@PostMapping("/article/edit")
|
||||
@Transactional
|
||||
public String editArticle(@RequestParam Long articleId,
|
||||
@ModelAttribute ArticleForm articleForm, Authentication authentication) {
|
||||
@ModelAttribute ArticleForm articleForm, @AuthenticationPrincipal PrincipalDetails principal) {
|
||||
|
||||
PrincipalDetails principal = (PrincipalDetails) authentication.getPrincipal();
|
||||
articleForm.setMemberId(principal.getMemberId());
|
||||
articleService.editArticle(articleId, articleForm);
|
||||
|
||||
|
||||
|
||||
@@ -30,16 +30,20 @@ public class Article extends BasicEntity {
|
||||
|
||||
@Column(nullable = false)
|
||||
private String title;
|
||||
|
||||
@Column(nullable = false, length = 10000)
|
||||
private String content;
|
||||
|
||||
@Column(columnDefinition = "bigint default 0",nullable = false)
|
||||
private Long hit;
|
||||
|
||||
private String toc;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String thumbnailUrl;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "member_id")
|
||||
@JoinColumn(name = "member_id", nullable = false)
|
||||
private Member member;
|
||||
|
||||
@OneToMany(mappedBy = "article", cascade = CascadeType.REMOVE, orphanRemoval = true)
|
||||
@@ -47,7 +51,7 @@ public class Article extends BasicEntity {
|
||||
private List<ArticleTagList> articleTagLists = new ArrayList<>();
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "category_id")
|
||||
@JoinColumn(name = "category_id", nullable = false)
|
||||
private Category category;
|
||||
|
||||
@OneToMany(mappedBy = "article", cascade = CascadeType.REMOVE, orphanRemoval = true)
|
||||
@@ -64,10 +68,12 @@ public class Article extends BasicEntity {
|
||||
this.toc = toc;
|
||||
this.member = member;
|
||||
this.thumbnailUrl = thumbnailUrl;
|
||||
this.hit = 0L;
|
||||
this.category = category;
|
||||
this.hit = 0L;
|
||||
}
|
||||
|
||||
// 비지니스 로직 //
|
||||
|
||||
public void addHit(){
|
||||
this.hit++;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package myblog.blog.article.dto;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import myblog.blog.article.domain.Article;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Objects;
|
||||
@@ -15,13 +16,12 @@ public class ArticleForm {
|
||||
@NotBlank
|
||||
private String content;
|
||||
private String toc;
|
||||
@NotBlank
|
||||
private Long memberId;
|
||||
|
||||
private String thumbnailUrl;
|
||||
|
||||
@NotBlank
|
||||
private String category;
|
||||
@NotBlank
|
||||
private String tags;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,34 +8,51 @@ import org.springframework.data.domain.Slice;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface ArticleRepository extends JpaRepository<Article, Long> {
|
||||
|
||||
/*
|
||||
- 최대 6개까지 조회수가 높은 게시물 가져오기
|
||||
*/
|
||||
List<Article> findTop6ByOrderByHitDesc();
|
||||
|
||||
/*
|
||||
- 카테고리별 최대 6개 최신 게시물순으로 가져오기 페이징처리 x
|
||||
*/
|
||||
List<Article> findTop6ByCategoryOrderByIdDesc(Category category);
|
||||
|
||||
/*
|
||||
- 가장 최신 게시물순으로 페이징처리해서 Slice로 가져오기
|
||||
토탈 카운트 쿼리 안날라감
|
||||
*/
|
||||
Slice<Article> findByOrderByIdDesc(Pageable pageable);
|
||||
|
||||
/*
|
||||
- 카테고리별(하위 카테고리) 페이징 처리해서 최신게시물순으로 Slice 가져오기
|
||||
*/
|
||||
@Query("select a " +
|
||||
"from Article a " +
|
||||
"inner join a.category c " +
|
||||
"where c.title=:category " +
|
||||
"order by a.id desc ")
|
||||
Slice<Article> findByCategoryOrderByIdDesc(Pageable pageable, @Param("category") String category);
|
||||
Slice<Article> findBySubCategoryOrderByIdDesc(Pageable pageable, @Param("category") String category);
|
||||
|
||||
/*
|
||||
- 카테고리별(상위 카테고리) 페이징 처리해서 최신게시물순으로 Slice 가져오기
|
||||
*/
|
||||
@Query("select a " +
|
||||
"from Article a " +
|
||||
"inner join a.category c " +
|
||||
"left join c.parents p " +
|
||||
"where p.title=:category " +
|
||||
"order by a.id desc ")
|
||||
Slice<Article> findByT1CategoryOrderByIdDesc(Pageable pageable, @Param("category") String category);
|
||||
|
||||
Slice<Article> findAllByOrderByIdDesc(Pageable pageable);
|
||||
|
||||
Slice<Article> findBySupCategoryOrderByIdDesc(Pageable pageable, @Param("category") String category);
|
||||
|
||||
/*
|
||||
- 카테고리와 태그를 모두 페치조인해서 아티클 조회
|
||||
- 아티클 세부 조회용도
|
||||
*/
|
||||
@Query("select a " +
|
||||
"from Article a " +
|
||||
"join fetch a.category " +
|
||||
@@ -44,15 +61,10 @@ public interface ArticleRepository extends JpaRepository<Article, Long> {
|
||||
"where a.id =:id ")
|
||||
Article findArticleByIdFetchCategoryAndTags(@Param("id") Long articleId);
|
||||
|
||||
@Query("select a " +
|
||||
"from Article a " +
|
||||
"join fetch a.category " +
|
||||
"join fetch a.articleTagLists " +
|
||||
"where a.id =:id ")
|
||||
Article findArticleByIdFetchCategoryAndArticleTagLists(@Param("id") Long articleId);
|
||||
|
||||
List<Article> findTop6ByCategoryOrderByIdDesc(Category category);
|
||||
|
||||
/*
|
||||
- 태그별 아티클 페이징 처리해서 조회
|
||||
- 토탈 카운트 쿼리 o
|
||||
*/
|
||||
@Query("select a " +
|
||||
"from Article a " +
|
||||
"join a.articleTagLists at " +
|
||||
@@ -61,7 +73,10 @@ public interface ArticleRepository extends JpaRepository<Article, Long> {
|
||||
"order by a.id desc ")
|
||||
Page<Article> findAllByArticleTagsOrderById(Pageable pageable, @Param("tag") String tag);
|
||||
|
||||
|
||||
/*
|
||||
- 키워드별 아티클 페이징 처리해서 조회
|
||||
- 토탈 카운트 쿼리 o
|
||||
*/
|
||||
@Query("select a " +
|
||||
"from Article a " +
|
||||
"where a.title like %:keyword% " +
|
||||
@@ -69,6 +84,4 @@ public interface ArticleRepository extends JpaRepository<Article, Long> {
|
||||
"order by a.id desc ")
|
||||
Page<Article> findAllByKeywordOrderById(Pageable pageable, @Param("keyword") String keyword);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface NaArticleRepository {
|
||||
|
||||
|
||||
/*
|
||||
- 삭제처리시 불필요한 조회방지 위해 네이티브 쿼리 사용 cascade delete 처리
|
||||
*/
|
||||
@Delete("delete from article " +
|
||||
"where article_id = #{articleId} ")
|
||||
void deleteArticle(Long articleId);
|
||||
|
||||
@@ -3,5 +3,6 @@ package myblog.blog.article.repository;
|
||||
import myblog.blog.article.domain.TempArticle;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
// 기본 JPA 메소드 사용
|
||||
public interface TempArticleRepository extends JpaRepository<TempArticle, Long> {
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Slice;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
@@ -37,34 +37,49 @@ public class ArticleService {
|
||||
@Value("${git.repo}")
|
||||
private String gitRepo;
|
||||
|
||||
private final ArticleRepository articleRepository;
|
||||
private final MemberRepository memberRepository;
|
||||
private final TagsService tagsService;
|
||||
private final CategoryService categoryService;
|
||||
private final ModelMapper modelMapper;
|
||||
private final ArticleRepository articleRepository;
|
||||
private final NaArticleRepository naArticleRepository;
|
||||
private final ModelMapper modelMapper;
|
||||
|
||||
public Article writeArticle(ArticleForm articleDto) {
|
||||
|
||||
Article newArticle = articleFrom(articleDto);
|
||||
/*
|
||||
- 아티클 작성 로직
|
||||
*/
|
||||
public Article writeArticle(ArticleForm articleDto, Member writer) {
|
||||
|
||||
Article newArticle = articleFrom(articleDto, writer);
|
||||
articleRepository.save(newArticle);
|
||||
tagsService.createNewTagsAndArticleTagList(articleDto.getTags(), newArticle);
|
||||
|
||||
return newArticle;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
- 아티클 수정 로직
|
||||
*/
|
||||
public void editArticle(Long articleId, ArticleForm articleForm) {
|
||||
|
||||
Article article = articleRepository.findById(articleId).get();
|
||||
Category category = categoryService.findCategory(articleForm.getCategory());
|
||||
tagsService.deleteArticleTags(article);
|
||||
tagsService.createNewTagsAndArticleTagList(articleForm.getTags(), article);
|
||||
articleForm.setThumbnailUrl(makeDefaultThumb(articleForm.getThumbnailUrl()));
|
||||
|
||||
// 더티 체킹으로 업데이트
|
||||
article.editArticle(articleForm,category);
|
||||
}
|
||||
|
||||
/*
|
||||
- 메인화면 위한 인기 아티클 6개 목록 가져오기
|
||||
*/
|
||||
public List<ArticleDtoForMain> getPopularArticles() {
|
||||
List<Article> top6ByOrderByHitDesc = articleRepository.findTop6ByOrderByHitDesc();
|
||||
|
||||
List<ArticleDtoForMain> articles = new ArrayList<>();
|
||||
|
||||
for (Article article : top6ByOrderByHitDesc) {
|
||||
articles.add(modelMapper.map(article, ArticleDtoForMain.class));
|
||||
}
|
||||
|
||||
|
||||
List<ArticleDtoForMain> articles = top6ByOrderByHitDesc.stream()
|
||||
.map(article -> modelMapper.map(article, ArticleDtoForMain.class))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return articles;
|
||||
|
||||
}
|
||||
@@ -101,19 +116,19 @@ public class ArticleService {
|
||||
|
||||
Slice<Article> articles = null;
|
||||
|
||||
if (tier.intValue() == 0) {
|
||||
if (tier.equals(0)) {
|
||||
articles = articleRepository
|
||||
.findAllByOrderByIdDesc(
|
||||
PageRequest.of(pageResolver(page), 5));
|
||||
} else if (tier.intValue() == 1) {
|
||||
.findByOrderByIdDesc(
|
||||
PageRequest.of(pageResolve(page), 5));
|
||||
} else if (tier.equals(1)) {
|
||||
articles = articleRepository
|
||||
.findByT1CategoryOrderByIdDesc(
|
||||
PageRequest.of(pageResolver(page), 5), category);
|
||||
.findBySupCategoryOrderByIdDesc(
|
||||
PageRequest.of(pageResolve(page), 5), category);
|
||||
|
||||
} else {
|
||||
articles = articleRepository
|
||||
.findByCategoryOrderByIdDesc(
|
||||
PageRequest.of(pageResolver(page), 5), category);
|
||||
.findBySubCategoryOrderByIdDesc(
|
||||
PageRequest.of(pageResolve(page), 5), category);
|
||||
}
|
||||
|
||||
return articles.map(article -> modelMapper
|
||||
@@ -132,21 +147,10 @@ public class ArticleService {
|
||||
|
||||
public Article getArticleForEdit(Long articleId){
|
||||
|
||||
return articleRepository.findArticleByIdFetchCategoryAndArticleTagLists(articleId);
|
||||
return articleRepository.findArticleByIdFetchCategoryAndTags(articleId);
|
||||
|
||||
}
|
||||
|
||||
public void editArticle(Long articleId, ArticleForm articleForm) {
|
||||
|
||||
Article article = articleRepository.findById(articleId).get();
|
||||
Category category = categoryService.findCategory(articleForm.getCategory());
|
||||
tagsService.deleteArticleTags(article);
|
||||
tagsService.createNewTagsAndArticleTagList(articleForm.getTags(), article);
|
||||
articleForm.setThumbnailUrl(makeDefaultThumb(articleForm.getThumbnailUrl()));
|
||||
|
||||
article.editArticle(articleForm,category);
|
||||
|
||||
}
|
||||
|
||||
public void deleteArticle(Long articleId) {
|
||||
|
||||
@@ -163,7 +167,7 @@ public class ArticleService {
|
||||
|
||||
Page<Article> articles =
|
||||
articleRepository
|
||||
.findAllByArticleTagsOrderById(PageRequest.of(pageResolver(page), 5), tag);
|
||||
.findAllByArticleTagsOrderById(PageRequest.of(pageResolve(page), 5), tag);
|
||||
|
||||
return articles;
|
||||
|
||||
@@ -173,7 +177,7 @@ public class ArticleService {
|
||||
|
||||
Page<Article> articles =
|
||||
articleRepository
|
||||
.findAllByKeywordOrderById(PageRequest.of(pageResolver(page),5), keyword);
|
||||
.findAllByKeywordOrderById(PageRequest.of(pageResolve(page),5), keyword);
|
||||
|
||||
return articles;
|
||||
}
|
||||
@@ -194,7 +198,6 @@ public class ArticleService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String makeDefaultThumb(String thumbnailUrl) {
|
||||
// 메시지로 올리기
|
||||
String defaultThumbUrl = "https://cdn.pixabay.com/photo/2020/11/08/13/28/tree-5723734_1280.jpg";
|
||||
@@ -205,25 +208,21 @@ public class ArticleService {
|
||||
return thumbnailUrl;
|
||||
}
|
||||
|
||||
private int pageResolver(Integer rawPage) {
|
||||
private int pageResolve(Integer rawPage) {
|
||||
if (rawPage == null || rawPage == 1) {
|
||||
return 0;
|
||||
} else return rawPage - 1;
|
||||
}
|
||||
|
||||
private Article articleFrom(ArticleForm articleDto) {
|
||||
Member member =
|
||||
memberRepository.findById(articleDto.getMemberId()).orElseThrow(() -> {
|
||||
throw new IllegalArgumentException("작성자를 확인할 수 없습니다");
|
||||
});
|
||||
private Article articleFrom(ArticleForm articleDto, Member writer) {
|
||||
|
||||
return Article.builder()
|
||||
.title(articleDto.getTitle())
|
||||
.content(articleDto.getContent())
|
||||
.toc(articleDto.getToc())
|
||||
.member(writer)
|
||||
.thumbnailUrl(makeDefaultThumb(articleDto.getThumbnailUrl()))
|
||||
.category(categoryService.findCategory(articleDto.getCategory()))
|
||||
.member(member)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import myblog.blog.article.domain.TempArticle;
|
||||
import myblog.blog.article.dto.TempArticleDto;
|
||||
import myblog.blog.article.repository.TempArticleRepository;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@@ -14,23 +13,28 @@ public class TempArticleService {
|
||||
|
||||
private final TempArticleRepository tempArticleRepository;
|
||||
|
||||
public TempArticle saveTemp(TempArticleDto tempArticleDto){
|
||||
/*
|
||||
- 자동 저장 로직
|
||||
- ID값 고정으로 머지를 작동시켜 임시글 DB에 1개 유지
|
||||
*/
|
||||
public void saveTemp(TempArticleDto tempArticleDto){
|
||||
|
||||
TempArticle tempArticle = new TempArticle(tempArticleDto.getContent());
|
||||
|
||||
// 머지로 쿼리 한번만 날리기
|
||||
tempArticleRepository.save(tempArticle);
|
||||
|
||||
return tempArticle;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
- 임시글 가져오기
|
||||
*/
|
||||
public Optional<TempArticle> getTempArticle(){
|
||||
|
||||
return tempArticleRepository.findById(1L);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
- 임시글 삭제
|
||||
*/
|
||||
public void deleteTemp(){
|
||||
Optional<TempArticle> deleteArticle = tempArticleRepository.findById(1L);
|
||||
deleteArticle.ifPresent(tempArticleRepository::delete);
|
||||
|
||||
@@ -168,7 +168,9 @@ public class CategoryService {
|
||||
}
|
||||
|
||||
|
||||
@PostConstruct
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void insertCategory() {
|
||||
|
||||
Category category0 = Category.builder()
|
||||
|
||||
@@ -5,10 +5,7 @@ import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest;
|
||||
import org.springframework.security.oauth2.core.user.OAuth2User;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -19,7 +16,7 @@ public class UserInfoFactory {
|
||||
private final static Map<ProviderType, Function<OAuth2User, Oauth2UserInfo>> userInfoFactoryMap;
|
||||
|
||||
static {
|
||||
userInfoFactoryMap = new HashMap<>();
|
||||
userInfoFactoryMap = new EnumMap<>(ProviderType.class);
|
||||
userInfoFactoryMap.put(ProviderType.GOOGLE, GoogleUserInfo::new);
|
||||
userInfoFactoryMap.put(ProviderType.FACEBOOK, FacebookUserInfo::new);
|
||||
userInfoFactoryMap.put(ProviderType.KAKAO, KakaoUserInfo::new);
|
||||
|
||||
@@ -6,25 +6,25 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable = no, initial-scale=1.0"/>
|
||||
<title th:text="|${param.tag} 검색 결과 - Jinia's LOG'|"></title>
|
||||
<title th:text="|'${param.tagName}' 태그 검색 결과 - Jinia's LOG|"></title>
|
||||
<!-- SEO -->
|
||||
<meta name="description" th:content="|${param.tag} 검색 결과|"/>
|
||||
<meta name="keyword" th:content="|${param.tag}, 카테고리, 개발, 테크, IT, 코딩, 알고리즘, 쥬니어, 개발자, 포트폴리오, 블로그, CS, 컴공지식, 컴공, 프로그래밍, 프로그래밍 언어, 비전공, 코딩 테스트, 취업, 취준|"/>
|
||||
<meta name="description" th:content="|${param.tagName} 검색 결과|"/>
|
||||
<meta name="keyword" th:content="|${param.tagName}, 카테고리, 개발, 테크, IT, 코딩, 알고리즘, 쥬니어, 개발자, 포트폴리오, 블로그, CS, 컴공지식, 컴공, 프로그래밍, 프로그래밍 언어, 비전공, 코딩 테스트, 취업, 취준|"/>
|
||||
<meta name="author" content="Jinia"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
|
||||
<!-- OPEN GRAPH(FACEBOOK, LINKEDIN) -->
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:description" th:content="|${param.tag} 검색 결과|"/>
|
||||
<meta property="og:title" th:content="|${param.tag} 검색 결과 - Jinia's LOG'|"/>
|
||||
<meta property="og:description" th:content="|${param.tagName} 검색 결과|"/>
|
||||
<meta property="og:title" th:content="|${param.tagName} 검색 결과 - Jinia's LOG|"/>
|
||||
<meta property="og:image" content="https://github.com/jinia91/blogTest/blob/main/img/a341399c-494f-4a1b-9c03-8d566a3a4097.png?raw=true"/>
|
||||
<meta property="og:url" content=""/>
|
||||
<meta property="og:site_name" content="|${param.tag} 검색 결과 - Jinia's LOG'|"/>
|
||||
<meta property="og:site_name" content="|${param.tagName} 검색 결과 - Jinia's LOG'|"/>
|
||||
|
||||
<!-- twitter -->
|
||||
<meta property="twitter:card" th:content="|${param.tag} 검색 결과|"/>
|
||||
<meta property="twitter:title" th:content="|${param.tag} 검색 결과 - Jinia's LOG'|"/>
|
||||
<meta property="twitter:description" th:content="|${param.tag} 검색 결과|"/>
|
||||
<meta property="twitter:card" th:content="|${param.tagName} 검색 결과|"/>
|
||||
<meta property="twitter:title" th:content="|${param.tagName} 검색 결과 - Jinia's LOG'|"/>
|
||||
<meta property="twitter:description" th:content="|${param.tagName} 검색 결과|"/>
|
||||
<meta property="twitter:image" content="https://github.com/jinia91/blogTest/blob/main/img/a341399c-494f-4a1b-9c03-8d566a3a4097.png?raw=true"/>
|
||||
<meta property="twitter:url" content=""/>
|
||||
<meta property="twitter:creator" content="Jinia"/>
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="recent-cards mt-5 ms-4 me-4">
|
||||
|
||||
<div class="cards-container container p-0" id="infiniteScrollBox">
|
||||
<h1 class="text-center" th:text="${param.tag}"></h1>
|
||||
<h1 class="text-center" th:text="|'${param.tagName}' 태그 검색 결과|"></h1>
|
||||
<hr>
|
||||
<div id="articlePage-0">
|
||||
<div class="card mb-3 recent-card wow fadeInUp" th:each="article :${articleList.getContent()}">
|
||||
@@ -85,7 +85,7 @@
|
||||
<ul class="pagination">
|
||||
<li class="page-item">
|
||||
<a class="page-link" aria-label="First"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tag}),page=(1))}"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tagName}),page=(1))}"
|
||||
th:if="${pagingBox.getCurPageNum()}>5">
|
||||
<span>«</span>
|
||||
</a>
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
<li class="page-item">
|
||||
<a class="page-link" aria-label="Previous"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tag}),page=(${pagingBox.getCurPageNum()}-5))}"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tagName}),page=(${pagingBox.getCurPageNum()}-5))}"
|
||||
th:if="${pagingBox.getCurPageNum()}>5">
|
||||
<span>
|
||||
< </span>
|
||||
@@ -103,16 +103,16 @@
|
||||
<th:block th:each="page : ${#numbers.sequence(pagingBox.getBoxStartNum(), pagingBox.getBoxEndNum())}">
|
||||
<li th:if="${pagingBox.getCurPageNum()==page}" class="page-item active">
|
||||
<a th:text="${page}" class="page-link"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tag}),page=(${page}))}"></a>
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tagName}),page=(${page}))}"></a>
|
||||
</li>
|
||||
<li th:unless="${pagingBox.getCurPageNum()==page}" class="page-item">
|
||||
<a th:text="${page}" class="page-link"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tag}),page=(${page}))}"></a>
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tagName}),page=(${page}))}"></a>
|
||||
</li>
|
||||
</th:block>
|
||||
<li class="page-item">
|
||||
<a class="page-link" aria-label="Next"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tag}),page=(${pagingBox.getCurPageNum()}+5))}"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tagName}),page=(${pagingBox.getCurPageNum()}+5))}"
|
||||
th:if="${pagingBox.getCurPageNum()<=pagingBox.getPNumForNextBtn()}"
|
||||
>
|
||||
<span aria-hidden="true">></span>
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
<li class="page-item">
|
||||
<a class="page-link" aria-label="Last"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tag}),page=(${pagingBox.getLastPageNum()}))}"
|
||||
th:href="@{/article/list/tag/(tagName=(${param.tagName}),page=(${pagingBox.getLastPageNum()}))}"
|
||||
th:if="${pagingBox.getCurPageNum()<=pagingBox.getPNumForNextBtn()}"
|
||||
>
|
||||
<span aria-hidden="true">»</span>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package myblog.blog;
|
||||
|
||||
import myblog.blog.category.domain.Category;
|
||||
import myblog.blog.category.service.CategoryService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class BlogApplicationTests {
|
||||
|
||||
@Autowired
|
||||
CategoryService categoryService;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package myblog.blog;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.security.test.context.support.WithMockUser;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.ResultActions;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@SpringBootTest
|
||||
@AutoConfigureMockMvc
|
||||
class MainControllerTest {
|
||||
|
||||
@Autowired
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@Test
|
||||
@WithMockUser(roles = "ADMIN")
|
||||
public void 권한테스트() throws Exception {
|
||||
// given
|
||||
// when
|
||||
ResultActions admin = mockMvc.perform(get("/admin"));
|
||||
// then
|
||||
admin.andExpect(status().isOk());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,201 @@
|
||||
package myblog.blog.article.repository;
|
||||
|
||||
import myblog.blog.article.domain.Article;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import myblog.blog.category.domain.Category;
|
||||
import myblog.blog.category.repository.CategoryRepository;
|
||||
import myblog.blog.member.doamin.Member;
|
||||
import myblog.blog.member.repository.MemberRepository;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Slice;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import javax.persistence.EntityManager;
|
||||
import java.sql.BatchUpdateException;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
class ArticleRepositoryTest {
|
||||
|
||||
@Autowired
|
||||
ArticleRepository articleRepository;
|
||||
@Autowired
|
||||
CategoryRepository categoryRepository;
|
||||
@Autowired
|
||||
MemberRepository memberRepository;
|
||||
@Autowired
|
||||
EntityManager entityManager;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
void 카테고리더미삽입(){
|
||||
|
||||
// 카테고리 삽입
|
||||
|
||||
// 필수 삽입 더미 카테고리
|
||||
Category category0 = Category.builder()
|
||||
.tier(0)
|
||||
.title("total")
|
||||
.pSortNum(0)
|
||||
.cSortNum(0)
|
||||
.build();
|
||||
categoryRepository.save(category0);
|
||||
|
||||
// 부모 카테고리
|
||||
Category category1 = Category.builder()
|
||||
.tier(1)
|
||||
.title("카테고리 부모")
|
||||
.pSortNum(1)
|
||||
.cSortNum(0)
|
||||
.build();
|
||||
categoryRepository.save(category1);
|
||||
|
||||
// 자식 카테고리
|
||||
Category category2 = Category.builder()
|
||||
.tier(2)
|
||||
.title("카테고리 자식")
|
||||
.pSortNum(1)
|
||||
.cSortNum(1)
|
||||
.parents(category1)
|
||||
.build();
|
||||
categoryRepository.save(category2);
|
||||
|
||||
// 멤버 삽입은 postConstruct로
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void 카테고리별검색() throws Exception {
|
||||
// given
|
||||
PageRequest of = PageRequest.of(0, 5);
|
||||
void 글작성성공테스트() throws Exception {
|
||||
|
||||
Category category2 = categoryRepository.findByTitle("카테고리 자식");
|
||||
Member admin = memberRepository.findById(1L).get();
|
||||
|
||||
Article newArticle = Article.builder()
|
||||
.category(category2)
|
||||
.content("테스트")
|
||||
.thumbnailUrl("더미")
|
||||
.title("테스트")
|
||||
.member(admin)
|
||||
.toc(null)
|
||||
.build();
|
||||
|
||||
|
||||
// when
|
||||
|
||||
Slice<Article> articles = articleRepository.findByCategoryOrderByIdDesc(of, "child");
|
||||
Article savedArticle = articleRepository.save(newArticle);
|
||||
Long articleId = savedArticle.getId();
|
||||
|
||||
entityManager.flush();
|
||||
entityManager.clear();
|
||||
|
||||
// then
|
||||
|
||||
assertThat(articles.getContent()).isNotNull();
|
||||
Assertions
|
||||
.assertThat(articleRepository.findById(articleId).isPresent()).isTrue();
|
||||
|
||||
Assertions.assertThat(savedArticle.getContent())
|
||||
.isEqualTo(articleRepository.findById(articleId).get().getContent());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void 글작성실패() throws Exception {
|
||||
// given
|
||||
Category category2 = categoryRepository.findByTitle("카테고리 자식");
|
||||
Member admin = memberRepository.findById(1L).get();
|
||||
|
||||
// 타이틀 없는 아티클
|
||||
Article nullTitle = Article.builder()
|
||||
.category(category2)
|
||||
.content("테스트")
|
||||
.thumbnailUrl("더미")
|
||||
// .title("테스트")
|
||||
.member(admin)
|
||||
.toc(null)
|
||||
.build();
|
||||
|
||||
//썸네일 없는 아티클
|
||||
Article nullThumbnail = Article.builder()
|
||||
.category(category2)
|
||||
.content("테스트")
|
||||
// .thumbnailUrl("더미")
|
||||
.title("테스트")
|
||||
.member(admin)
|
||||
.toc(null)
|
||||
.build();
|
||||
|
||||
// 내용 없는 아티클
|
||||
Article nullContents = Article.builder()
|
||||
.category(category2)
|
||||
// .content("테스트")
|
||||
.thumbnailUrl("더미")
|
||||
.title("테스트")
|
||||
.member(admin)
|
||||
.toc(null)
|
||||
.build();
|
||||
|
||||
// 카테고리 없는 아티클
|
||||
Article nullCategory = Article.builder()
|
||||
// .category(category2)
|
||||
.content("테스트")
|
||||
.thumbnailUrl("더미")
|
||||
.title("테스트")
|
||||
.member(admin)
|
||||
.toc(null)
|
||||
.build();
|
||||
|
||||
// 작성자 없는 아티클
|
||||
Article nullWriter = Article.builder()
|
||||
.category(category2)
|
||||
.content("테스트")
|
||||
.thumbnailUrl("더미")
|
||||
.title("테스트")
|
||||
// .member(admin)
|
||||
.toc(null)
|
||||
.build();
|
||||
|
||||
|
||||
// when
|
||||
|
||||
org.junit.jupiter.api.Assertions.assertThrows(Exception.class,
|
||||
() ->
|
||||
{
|
||||
articleRepository.save(nullTitle);
|
||||
entityManager.flush();
|
||||
});
|
||||
org.junit.jupiter.api.Assertions.assertThrows(Exception.class,
|
||||
() ->
|
||||
{
|
||||
articleRepository.save(nullThumbnail);
|
||||
entityManager.flush();
|
||||
});
|
||||
org.junit.jupiter.api.Assertions.assertThrows(Exception.class,
|
||||
() ->
|
||||
{
|
||||
articleRepository.save(nullContents);
|
||||
entityManager.flush();
|
||||
});
|
||||
org.junit.jupiter.api.Assertions.assertThrows(Exception.class,
|
||||
() ->
|
||||
{
|
||||
articleRepository.save(nullCategory);
|
||||
entityManager.flush();
|
||||
});
|
||||
org.junit.jupiter.api.Assertions.assertThrows(Exception.class,
|
||||
() ->
|
||||
{
|
||||
articleRepository.save(nullWriter);
|
||||
entityManager.flush();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
package myblog.blog.article.service;
|
||||
|
||||
import myblog.blog.article.domain.Article;
|
||||
import myblog.blog.article.repository.ArticleRepository;
|
||||
import myblog.blog.category.domain.Category;
|
||||
import myblog.blog.category.dto.CategoryNormalDto;
|
||||
import myblog.blog.category.dto.CategoryForView;
|
||||
import myblog.blog.category.repository.CategoryRepository;
|
||||
import myblog.blog.category.repository.NaCategoryRepository;
|
||||
import myblog.blog.category.service.CategoryService;
|
||||
import myblog.blog.member.repository.MemberRepository;
|
||||
import myblog.blog.member.service.Oauth2MemberService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
@Rollback(value = false)
|
||||
class ArticleServiceTest {
|
||||
|
||||
@Autowired
|
||||
ArticleService articleService;
|
||||
@Autowired
|
||||
ArticleRepository articleRepository;
|
||||
@Autowired
|
||||
EntityManager entityManager;
|
||||
@Autowired
|
||||
Oauth2MemberService memberService;
|
||||
@Autowired
|
||||
CategoryService categoryService;
|
||||
@Autowired
|
||||
MemberRepository memberRepository;
|
||||
@Autowired
|
||||
CategoryRepository categoryRepository;
|
||||
|
||||
@Autowired
|
||||
NaCategoryRepository naCategoryRepository;
|
||||
|
||||
// @BeforeEach
|
||||
void 더미게시글() {
|
||||
memberService.insertAdmin();
|
||||
|
||||
Category ca1 = Category.builder()
|
||||
.title("CA1")
|
||||
.tier(1)
|
||||
.build();
|
||||
Category category1 = ca1;
|
||||
Category ca2 = Category.builder()
|
||||
.title("CA2")
|
||||
.tier(1)
|
||||
.build();
|
||||
Category category2 = ca2;
|
||||
Category category3 = Category.builder()
|
||||
.title("Java")
|
||||
.tier(2)
|
||||
.parents(ca1)
|
||||
.build();
|
||||
Category category4 = Category.builder()
|
||||
.title("Spring")
|
||||
.parents(ca1)
|
||||
.tier(2)
|
||||
.build();
|
||||
Category category5 = Category.builder()
|
||||
.title("Jpa")
|
||||
.parents(ca2)
|
||||
.tier(2)
|
||||
.build();
|
||||
|
||||
categoryRepository.save(category1);
|
||||
categoryRepository.save(category2);
|
||||
categoryRepository.save(category3);
|
||||
categoryRepository.save(category4);
|
||||
categoryRepository.save(category5);
|
||||
|
||||
String[] arr = {"Java", "Spring", "Jpa"};
|
||||
|
||||
int n = 100;
|
||||
while (n-- > 0) {
|
||||
|
||||
articleRepository.save(Article.builder()
|
||||
.title(UUID.randomUUID().toString())
|
||||
.content(String.valueOf(100 - n))
|
||||
.thumbnailUrl("https://picsum.photos/600/59" + (int) (Math.random() * 10))
|
||||
.category(categoryService.findCategory(arr[(int) (Math.random() * 3)]))
|
||||
.member(memberRepository.findById(1L).get())
|
||||
.build());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
// public void 게시글테스트() throws Exception {
|
||||
|
||||
// List<Article> popularArticle = articleRepository.findTop6ByOrderByHitDesc();
|
||||
//
|
||||
// for (Article article : popularArticle) {
|
||||
// System.out.println("article.getId() = " + article.getId());
|
||||
// }
|
||||
//
|
||||
// List<Article> top5ByOOrderByCreatedDateDesc = articleRepository.findTop5ByOrderByCreatedDateDesc();
|
||||
//
|
||||
// for (Article article : top5ByOOrderByCreatedDateDesc) {
|
||||
// System.out.println("article.getCreatedDate() = " + article.getCreatedDate());
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
// entityManager.clear();
|
||||
|
||||
// PageRequest createdDate = PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, "createdDate"));
|
||||
//
|
||||
// Slice<Article> articles = articleRepository.findByOrderByCreatedDateDesc(createdDate);
|
||||
//
|
||||
// List<Article> content = articles.getContent();
|
||||
//
|
||||
// for (Article article : content) {
|
||||
// System.out.println("article.getCreatedDate() = " + article.getCreatedDate());
|
||||
// System.out.println("article.getContent() = " + article.getContent());
|
||||
// }
|
||||
//
|
||||
//
|
||||
// System.out.println(articles.getNumber());
|
||||
// System.out.println(articles.getNumberOfElements());
|
||||
// System.out.println(articles.hasNext());
|
||||
// }
|
||||
//
|
||||
|
||||
@Test
|
||||
public void 더미데이터테스트() throws Exception {
|
||||
|
||||
|
||||
|
||||
List<CategoryNormalDto> categoryNormalDto = naCategoryRepository.getCategoryCount();
|
||||
|
||||
// for (CategoryCountForRepository count : categoryCountForRepository) {
|
||||
//
|
||||
// System.out.println("tier "+ count.getTier() + count.getTitle() +"(" + count.getCount()+")");
|
||||
//
|
||||
// }
|
||||
//
|
||||
|
||||
CategoryForView category = CategoryForView.createCategory(categoryNormalDto);
|
||||
|
||||
System.out.println("t1. " + category.getTitle() + "(" + category.getCount()+")");
|
||||
|
||||
List<CategoryForView> categoryTCountList = category.getCategoryTCountList();
|
||||
for (CategoryForView categoryForView : categoryTCountList) {
|
||||
System.out.println("ㄴt2. " + categoryForView.getTitle() + "(" + categoryForView.getCount()+")");
|
||||
List<CategoryForView> categoryTCountList1 = categoryForView.getCategoryTCountList();
|
||||
for (CategoryForView countForView : categoryTCountList1) {
|
||||
System.out.println(" ㄴt3. " + countForView.getTitle() + "(" + countForView.getCount() +")");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void 카테고리테스트() throws Exception {
|
||||
// given
|
||||
|
||||
articleRepository.save(Article.builder()
|
||||
.title(UUID.randomUUID().toString())
|
||||
.content(String.valueOf(166))
|
||||
.thumbnailUrl("https://picsum.photos/600/59" + (int) (Math.random() * 10))
|
||||
.category(categoryService.findCategory("child"))
|
||||
.member(memberRepository.findById(1L).get())
|
||||
.build());
|
||||
|
||||
articleRepository.save(Article.builder()
|
||||
.title(UUID.randomUUID().toString())
|
||||
.content(String.valueOf(133))
|
||||
.thumbnailUrl("https://picsum.photos/600/59" + (int) (Math.random() * 10))
|
||||
.category(categoryService.findCategory("child"))
|
||||
.member(memberRepository.findById(1L).get())
|
||||
.build());
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package myblog.blog.category.repository;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@SpringBootTest
|
||||
class CategoryRepositoryTest {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package myblog.blog.member.auth;
|
||||
|
||||
import myblog.blog.member.controller.MemberController;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
@SpringBootTest
|
||||
class UserInfoFactoryTest {
|
||||
|
||||
@Autowired
|
||||
UserInfoFactory userInfoFactory;
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void 싱글톤테스트() throws Exception {
|
||||
// given
|
||||
// UserInfoFactory userInfoFactory1 = new UserInfoFactory();
|
||||
// when
|
||||
|
||||
// then
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package myblog.blog.member.service;
|
||||
|
||||
import myblog.blog.member.doamin.Member;
|
||||
import myblog.blog.member.doamin.Role;
|
||||
import myblog.blog.member.repository.MemberRepository;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
@SpringBootTest
|
||||
class Oauth2MemberServiceTest {
|
||||
|
||||
@Autowired
|
||||
Oauth2MemberService oauth2MemberService;
|
||||
|
||||
@Autowired
|
||||
MemberRepository memberRepository;
|
||||
|
||||
@Test
|
||||
public void 권한테스트() throws Exception {
|
||||
// given
|
||||
Optional<Member> byId = memberRepository.findById(1L);
|
||||
Member admin = byId.get();
|
||||
|
||||
|
||||
// when
|
||||
|
||||
// then
|
||||
assertThat(admin.getRole().toString()).isEqualTo(Role.ADMIN.toString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user