From 32d9be1b770fd9e07e38b0ca3842ed3f7ebc921c Mon Sep 17 00:00:00 2001 From: SSUHYUNKIM Date: Fri, 7 Feb 2025 07:26:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FIX]=20=EC=A1=B0=ED=9A=8C=20=EC=95=88?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95(#4?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/DesignSystemService.java | 62 ++++++-- .../design/dao/DesignSystemRepository.java | 34 +++-- .../response/DesignSystemSearchResponse.java | 23 +-- .../design/DesignSystemServiceTest.java | 133 ++++++++++++++++++ .../ject/componote/fixture/DesignFixture.java | 56 ++++++++ 5 files changed, 274 insertions(+), 34 deletions(-) create mode 100644 src/test/java/ject/componote/domain/design/DesignSystemServiceTest.java create mode 100644 src/test/java/ject/componote/fixture/DesignFixture.java diff --git a/src/main/java/ject/componote/domain/design/application/DesignSystemService.java b/src/main/java/ject/componote/domain/design/application/DesignSystemService.java index c8172f27..570f8d9d 100644 --- a/src/main/java/ject/componote/domain/design/application/DesignSystemService.java +++ b/src/main/java/ject/componote/domain/design/application/DesignSystemService.java @@ -1,14 +1,8 @@ package ject.componote.domain.design.application; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - import ject.componote.domain.auth.model.AuthPrincipal; import ject.componote.domain.common.dto.response.PageResponse; import ject.componote.domain.design.dao.DesignSystemRepository; -import ject.componote.domain.design.dao.filter.DesignFilterRepository; -import ject.componote.domain.design.dao.link.DesignLinkRepository; import ject.componote.domain.design.domain.Design; import ject.componote.domain.design.domain.DesignSystem; import ject.componote.domain.design.domain.filter.DesignFilter; @@ -16,11 +10,17 @@ import ject.componote.domain.design.dto.search.request.DesignSystemSearchRequest; import ject.componote.domain.design.dto.search.response.DesignSystemSearchResponse; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j // 둜그 μΆ”κ°€ @Service @RequiredArgsConstructor @Transactional(readOnly = true) @@ -31,18 +31,29 @@ public class DesignSystemService { public PageResponse searchDesignSystem(final AuthPrincipal authPrincipal, final DesignSystemSearchRequest request, final Pageable pageable) { + log.info("πŸ”Ž [START] searchDesignSystem() 호좜 - AuthPrincipal: {}, Request: {}, Pageable: {}", authPrincipal, request, pageable); + + // 1️⃣ ν•„ν„° 쑰건에 λ§žλŠ” λ””μžμΈ ID 쑰회 List filteredDesignIds = getFilteredDesignIds(request); + log.info("πŸ“ [FILTER] ν•„ν„°λ§λœ Design ID λͺ©λ‘: {}", filteredDesignIds); + // 2️⃣ 쑰건에 λ§žλŠ” λ””μžμΈ λͺ©λ‘ 쑰회 Page designs = searchByConditions(authPrincipal, request.keyword(), filteredDesignIds, pageable); + log.info("πŸ“Œ [DESIGNS] 쑰회된 Design 개수: {}, λ‚΄μš©: {}", designs.getTotalElements(), designs.getContent()); List designIds = designs.getContent().stream().map(Design::getId).collect(Collectors.toList()); + // 3️⃣ DesignFilter 쑰회 Map> filtersMap = designSystemRepository.findFiltersByDesignIds(designIds) .stream().collect(Collectors.groupingBy(DesignFilter::getDesignId)); + log.info("πŸ”— [FILTER MAP] DesignFilter 개수: {}, 데이터: {}", filtersMap.size(), filtersMap); + // 4️⃣ DesignLink 쑰회 Map> linksMap = designSystemRepository.findLinksByDesignIds(designIds) .stream().collect(Collectors.groupingBy(DesignLink::getDesignId)); + log.info("🌍 [LINK MAP] DesignLink 개수: {}, 데이터: {}", linksMap.size(), linksMap); + // 5️⃣ μ΅œμ’… λ³€ν™˜ Page responsePage = designs.map(design -> { List filters = filtersMap.getOrDefault(design.getId(), List.of()); List links = linksMap.getOrDefault(design.getId(), List.of()); @@ -51,35 +62,58 @@ public PageResponse searchDesignSystem(final AuthPri return DesignSystemSearchResponse.from(designSystem); }); + log.info("βœ… [RESULT] μ΅œμ’… λ°˜ν™˜λ˜λŠ” 데이터 개수: {}, λ‚΄μš©: {}", responsePage.getTotalElements(), responsePage.getContent()); + return PageResponse.from(responsePage); } private Page searchByConditions(AuthPrincipal authPrincipal, String keyword, List filteredDesignIds, Pageable pageable) { + log.info("πŸ” [SEARCH CONDITIONS] AuthPrincipal: {}, keyword: {}, filteredDesignIds: {}, pageable: {}", + authPrincipal, keyword, filteredDesignIds, pageable); + + Page result; + if (authPrincipal != null) { - return !filteredDesignIds.isEmpty() - ? designSystemRepository.findAllByIdInAndBookmarkStatus(authPrincipal.id(), filteredDesignIds, pageable) - : designSystemRepository.findByKeywordAndBookmarkStatus(authPrincipal.id(), keyword, pageable); + if (!filteredDesignIds.isEmpty()) { + result = designSystemRepository.findAllByIdInAndBookmarkStatus(authPrincipal.id(), filteredDesignIds, pageable); + } else if (keyword != null && !keyword.isBlank()) { + result = designSystemRepository.findByKeywordAndBookmarkStatus(authPrincipal.id(), keyword, pageable); + } else { + result = designSystemRepository.findAllByBookmarkStatus(authPrincipal.id(), pageable); // πŸ”₯ μˆ˜μ •λœ λΆ€λΆ„: keywordκ°€ μ—†μœΌλ©΄ 전체 쑰회 + } + } else { + if (!filteredDesignIds.isEmpty()) { + result = designSystemRepository.findAllByIdIn(filteredDesignIds, pageable); + } else if (keyword != null && !keyword.isBlank()) { + result = designSystemRepository.findByKeyword(keyword, pageable); + } else { + result = designSystemRepository.findAll(pageable); // πŸ”₯ μˆ˜μ •λœ λΆ€λΆ„: keywordκ°€ μ—†μœΌλ©΄ 전체 쑰회 + } } - return !filteredDesignIds.isEmpty() - ? designSystemRepository.findAllByIdIn(filteredDesignIds, pageable) - : designSystemRepository.findByKeyword(keyword, pageable); + + log.info("πŸ“„ [SEARCH RESULT] 쑰회된 Design 개수: {}, λ‚΄μš©: {}", result.getTotalElements(), result.getContent()); + return result; } private List getFilteredDesignIds(DesignSystemSearchRequest request) { if (request.filters() == null || request.filters().isEmpty()) { + log.info("🚫 [FILTER] ν•„ν„°κ°€ μ—†μœΌλ―€λ‘œ λͺ¨λ“  λ””μžμΈ 포함"); return List.of(); } - return request.filters().stream() + List result = request.filters().stream() .flatMap(filter -> { List designIds = designSystemRepository.findAllDesignIdByCondition( filter.parseType(), filter.values() != null ? filter.values() : List.of() ); + log.info("πŸ“Œ [FILTER] {} ν•„ν„°λ‘œ κ²€μƒ‰λœ Design ID: {}", filter.parseType(), designIds); return designIds.stream(); }) .distinct() .collect(Collectors.toList()); - } + log.info("βœ… [FINAL FILTERED IDs] μ΅œμ’… ν•„ν„°λ§λœ Design ID λͺ©λ‘: {}", result); + return result; + } } diff --git a/src/main/java/ject/componote/domain/design/dao/DesignSystemRepository.java b/src/main/java/ject/componote/domain/design/dao/DesignSystemRepository.java index 36f1ee1d..d240c465 100644 --- a/src/main/java/ject/componote/domain/design/dao/DesignSystemRepository.java +++ b/src/main/java/ject/componote/domain/design/dao/DesignSystemRepository.java @@ -17,23 +17,12 @@ public interface DesignSystemRepository extends JpaRepository { countQuery = "SELECT COUNT(d) FROM Design d WHERE d.id IN :designIds") Page findAllByIdIn(@Param("designIds") List designIds, Pageable pageable); - @Query(value = "SELECT DISTINCT d FROM Design d WHERE d.summary.name LIKE %:keyword%", - countQuery = "SELECT COUNT(d) FROM Design d WHERE d.summary.name LIKE %:keyword%") - Page findByKeyword(@Param("keyword") String keyword, Pageable pageable); - @Query(value = "SELECT DISTINCT d FROM Design d WHERE d.id IN :designIds " + "AND EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)", countQuery = "SELECT COUNT(d) FROM Design d WHERE d.id IN :designIds " + "AND EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)") Page findAllByIdInAndBookmarkStatus(@Param("userId") Long userId, @Param("designIds") List designIds, Pageable pageable); - @Query(value = "SELECT DISTINCT d FROM Design d WHERE d.summary.name LIKE %:keyword% " + - "AND EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)", - countQuery = "SELECT COUNT(d) FROM Design d WHERE d.summary.name LIKE %:keyword% " + - "AND EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)") - Page findByKeywordAndBookmarkStatus(@Param("userId") Long userId, @Param("keyword") String keyword, Pageable pageable); - - @Query("SELECT df FROM DesignFilter df WHERE df.designId IN :designIds") List findFiltersByDesignIds(@Param("designIds") List designIds); @@ -44,4 +33,27 @@ public interface DesignSystemRepository extends JpaRepository { "WHERE df.type = :type AND df.value IN :values") List findAllDesignIdByCondition(@Param("type") FilterType type, @Param("values") List values); + @Query(value = "SELECT DISTINCT d FROM Design d", + countQuery = "SELECT COUNT(d) FROM Design d") + Page findAll(Pageable pageable); + + @Query(value = "SELECT DISTINCT d FROM Design d WHERE (:keyword IS NULL OR d.summary.name LIKE %:keyword%)", + countQuery = "SELECT COUNT(d) FROM Design d WHERE (:keyword IS NULL OR d.summary.name LIKE %:keyword%)") + Page findByKeyword(@Param("keyword") String keyword, Pageable pageable); + + @Query(value = "SELECT DISTINCT d FROM Design d WHERE (:keyword IS NULL OR d.summary.name LIKE %:keyword%) " + + "AND EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)", + countQuery = "SELECT COUNT(d) FROM Design d WHERE (:keyword IS NULL OR d.summary.name LIKE %:keyword%) " + + "AND EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)") + Page findByKeywordAndBookmarkStatus(@Param("userId") Long userId, @Param("keyword") String keyword, Pageable pageable); + + @Query(value = "SELECT DISTINCT d FROM Design d " + + "WHERE EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)", + countQuery = "SELECT COUNT(d) FROM Design d " + + "WHERE EXISTS (SELECT 1 FROM Bookmark b WHERE b.memberId = :userId AND b.resourceId = d.id)") + Page findAllByBookmarkStatus(@Param("userId") Long userId, Pageable pageable); + + + + } diff --git a/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java b/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java index 3e694f9b..c93e0313 100644 --- a/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java +++ b/src/main/java/ject/componote/domain/design/dto/search/response/DesignSystemSearchResponse.java @@ -14,15 +14,20 @@ public record DesignSystemSearchResponse( ) { public static DesignSystemSearchResponse from(DesignSystem designSystem) { return new DesignSystemSearchResponse( - designSystem.getDesign().getSummary().getName(), - designSystem.getDesign().getSummary().getOrganization(), - designSystem.getDesign().getSummary().getDescription(), - designSystem.getFilters().getFilters().stream() - .map(filter -> new DesignFilterSearchResponse(filter.getType().name(), List.of(filter.getValue()))) - .collect(Collectors.toList()), - designSystem.getLinks().getLinks().stream() - .map(link -> new DesignLinkResponse(link.getType().name().toLowerCase(), link.getUrl().getValue())) - .collect(Collectors.toList()) + designSystem.getDesign().getSummary().getName(), + designSystem.getDesign().getSummary().getOrganization(), + designSystem.getDesign().getSummary().getDescription(), + designSystem.getFilters().getFilters().stream() + .map(filter -> new DesignFilterSearchResponse(filter.getType().name(), List.of(filter.getValue()))) + .collect(Collectors.toList()), + designSystem.getLinks().getLinks().stream() + .filter(link -> link.getUrl() != null) // βœ… URL이 null이 μ•„λ‹Œ 경우만 처리 + .map(link -> new DesignLinkResponse( + link.getType().name().toLowerCase(), + link.getUrl().getValue() // βœ… null이면 빈 λ¬Έμžμ—΄ 처리 + )) + .collect(Collectors.toList()) ); } + } \ No newline at end of file diff --git a/src/test/java/ject/componote/domain/design/DesignSystemServiceTest.java b/src/test/java/ject/componote/domain/design/DesignSystemServiceTest.java new file mode 100644 index 00000000..354327da --- /dev/null +++ b/src/test/java/ject/componote/domain/design/DesignSystemServiceTest.java @@ -0,0 +1,133 @@ +//package ject.componote.domain.design; +// +//import ject.componote.domain.auth.model.AuthPrincipal; +//import ject.componote.domain.common.dto.response.PageResponse; +//import ject.componote.domain.design.application.DesignSystemService; +//import ject.componote.domain.design.dao.DesignSystemRepository; +//import ject.componote.domain.design.domain.Design; +//import ject.componote.domain.design.dto.search.request.DesignSystemSearchRequest; +//import ject.componote.domain.design.dto.search.response.DesignSystemSearchResponse; +//import ject.componote.fixture.DesignFixture; +//import ject.componote.fixture.MemberFixture; +//import org.junit.jupiter.api.BeforeEach; +//import org.junit.jupiter.api.DisplayName; +//import org.junit.jupiter.api.extension.ExtendWith; +//import org.junit.jupiter.params.ParameterizedTest; +//import org.junit.jupiter.params.provider.MethodSource; +//import org.mockito.InjectMocks; +//import org.mockito.Mock; +//import org.mockito.junit.jupiter.MockitoExtension; +//import org.springframework.data.domain.Page; +//import org.springframework.data.domain.PageImpl; +//import org.springframework.data.domain.PageRequest; +//import org.springframework.data.domain.Pageable; +// +//import java.util.Collections; +//import java.util.List; +//import java.util.stream.Stream; +// +//import static org.assertj.core.api.Assertions.assertThat; +//import static org.mockito.Mockito.*; +// +//@ExtendWith(MockitoExtension.class) +//class DesignSystemServiceTest { +// +// @Mock +// DesignSystemRepository designSystemRepository; +// +// @InjectMocks +// DesignSystemService designSystemService; +// +// AuthPrincipal authPrincipal; +// +// @BeforeEach +// public void init() { +// authPrincipal = AuthPrincipal.from(MemberFixture.KIM.생성(1L)); +// } +// +// static Stream provideSearchInputs() { +// final AuthPrincipal authPrincipal = AuthPrincipal.from(MemberFixture.KIM.생성(1L)); +// return Stream.of( +// new SearchInput("λΉ„νšŒμ›", null, "검색어"), +// new SearchInput("νšŒμ›", authPrincipal, "검색어") +// ); +// } +// +// @ParameterizedTest +// @MethodSource("provideSearchInputs") +// @DisplayName("λ””μžμΈ μ‹œμŠ€ν…œ 검색 성곡") +// public void searchDesignSystem_Success(final SearchInput input) { +// // given +// final Pageable pageable = PageRequest.of(0, 10); +// final Design design = DesignFixture.κΈ°λ³Έ_λ””μžμΈ_생성(); +// final Page designs = new PageImpl<>(List.of(design), pageable, 1); +// final DesignSystemSearchRequest request = new DesignSystemSearchRequest(input.keyword, null); +// +// when(designSystemRepository.findByKeyword(anyString(), any(Pageable.class))) +// .thenReturn(designs); +// +// // when +// PageResponse response = designSystemService.searchDesignSystem(input.authPrincipal, request, pageable); +// +// // then +// assertThat(response.getTotalElements()).isEqualTo(1); +// +// // βœ… μ‹€μ œλ‘œ ν•΄λ‹Ή λ©”μ„œλ“œκ°€ ν˜ΈμΆœλ˜μ—ˆλŠ”μ§€ 검증 +// verify(designSystemRepository).findByKeyword(anyString(), any(Pageable.class)); +// } +// +// @ParameterizedTest +// @MethodSource("provideSearchInputs") +// @DisplayName("λ””μžμΈ μ‹œμŠ€ν…œ 검색 - 검색 κ²°κ³Ό μ—†μŒ") +// public void searchDesignSystem_EmptyResult(final SearchInput input) { +// // given +// final Pageable pageable = PageRequest.of(0, 10); +// final DesignSystemSearchRequest request = new DesignSystemSearchRequest(input.keyword, null); +// final Page emptyPage = new PageImpl<>(Collections.emptyList(), pageable, 0); +// +// when(designSystemRepository.findByKeyword(anyString(), any(Pageable.class))) +// .thenReturn(emptyPage); +// +// // when +// PageResponse response = designSystemService.searchDesignSystem(input.authPrincipal, request, pageable); +// +// // then +// assertThat(response.getTotalElements()).isEqualTo(0); +// verify(designSystemRepository).findByKeyword(anyString(), any(Pageable.class)); +// } +// +// @ParameterizedTest +// @MethodSource("provideSearchInputs") +// @DisplayName("λ””μžμΈ μ‹œμŠ€ν…œ 검색 - ν•„ν„° 적용 ν›„ 검색") +// public void searchDesignSystem_WithFilters(final SearchInput input) { +// // given +// final Pageable pageable = PageRequest.of(0, 10); +// final List filteredDesignIds = List.of(1L, 2L); +// final DesignSystemSearchRequest request = new DesignSystemSearchRequest(input.keyword, List.of()); +// final Page designs = new PageImpl<>(List.of(DesignFixture.κΈ°λ³Έ_λ””μžμΈ_생성()), pageable, 1); +// +// when(designSystemRepository.findAllByIdIn(anyList(), any(Pageable.class))) +// .thenReturn(designs); +// +// // when +// PageResponse response = designSystemService.searchDesignSystem(input.authPrincipal, request, pageable); +// +// // then +// assertThat(response.getTotalElements()).isEqualTo(1); +// verify(designSystemRepository).findAllByIdIn(anyList(), any(Pageable.class)); +// } +// +// static class SearchInput { +// String displayName; +// AuthPrincipal authPrincipal; +// String keyword; +// +// public SearchInput(final String displayName, +// final AuthPrincipal authPrincipal, +// final String keyword) { +// this.displayName = displayName; +// this.authPrincipal = authPrincipal; +// this.keyword = keyword; +// } +// } +//} diff --git a/src/test/java/ject/componote/fixture/DesignFixture.java b/src/test/java/ject/componote/fixture/DesignFixture.java new file mode 100644 index 00000000..864fa5ca --- /dev/null +++ b/src/test/java/ject/componote/fixture/DesignFixture.java @@ -0,0 +1,56 @@ +package ject.componote.fixture; + +import ject.componote.domain.common.model.BaseImage; +import ject.componote.domain.design.domain.Design; +import ject.componote.domain.design.domain.filter.DesignFilter; +import ject.componote.domain.design.domain.link.DesignLink; +import ject.componote.domain.design.domain.filter.FilterType; +import ject.componote.domain.design.domain.link.LinkType; +import ject.componote.domain.design.model.Url; + +import java.util.List; + +public enum DesignFixture { + κΈ°λ³Έ_λ””μžμΈ("κΈ°λ³Έ λ””μžμΈ", "Componote", "이것은 κΈ°λ³Έ λ””μžμΈμž…λ‹ˆλ‹€.", "https://example.com/thumbnail1.png"), + μΆ”κ°€_λ””μžμΈ("μΆ”κ°€ λ””μžμΈ", "Componote", "이것은 좔가적인 λ””μžμΈμž…λ‹ˆλ‹€.", "https://example.com/thumbnail2.png"); + + private final String name; + private final String organization; + private final String description; + private final String thumbnailUrl; + + DesignFixture(String name, String organization, String description, String thumbnailUrl) { + this.name = name; + this.organization = organization; + this.description = description; + this.thumbnailUrl = thumbnailUrl; + } + + public Design 생성() { + return Design.of(name, organization, description, BaseImage.from(thumbnailUrl)); + } + + public static Design κΈ°λ³Έ_λ””μžμΈ_생성() { + return κΈ°λ³Έ_λ””μžμΈ.생성(); + } + + public static Design μΆ”κ°€_λ””μžμΈ_생성() { + return μΆ”κ°€_λ””μžμΈ.생성(); + } + + public static List ν•„ν„°_리슀트_생성(Long designId) { + return List.of( + DesignFilter.of(FilterType.DEVICE, "DEVICE", designId), + DesignFilter.of(FilterType.CONTENT, "CONTENT", designId) + ); + } + + public static List 링크_리슀트_생성(Long designId) { + return List.of( + DesignLink.of(Design.of("Sample", "Org", "Description", BaseImage.from("https://example.com/sample.png")), + LinkType.FIGMA, Url.from("https://example.com/link1")), + DesignLink.of(Design.of("Sample", "Org", "Description", BaseImage.from("https://example.com/sample.png")), + LinkType.CODE_PEN, Url.from("https://example.com/link2")) + ); + } +} From 0e6774614c9ce9e9b1c9948db814b95484be1bef Mon Sep 17 00:00:00 2001 From: SSUHYUNKIM Date: Fri, 7 Feb 2025 21:46:50 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[FIX]=20Type=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=9E=91=EC=97=85(#41)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/design/domain/filter/FilterType.java | 12 ++++++++++-- .../domain/design/domain/link/LinkType.java | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/ject/componote/domain/design/domain/filter/FilterType.java b/src/main/java/ject/componote/domain/design/domain/filter/FilterType.java index e451a862..b91d79c0 100644 --- a/src/main/java/ject/componote/domain/design/domain/filter/FilterType.java +++ b/src/main/java/ject/componote/domain/design/domain/filter/FilterType.java @@ -7,8 +7,16 @@ @Getter public enum FilterType { PLATFORM(List.of("GITHUB", "FIGMA", "STORYBOOK", "ZEROHEIGHT")), - TECHNOLOGY(List.of("REACT", "ANGULAR", "VUE")), - CONTENT(List.of("DESIGN_TOKEN", "CODE_EXAMPLES", "ACCESSIBILITY_GUIDE")), + TECHNOLOGY(List.of("ANGULAR", "NONE", "CSS", "CSS_IN_JS", "CSS_MODULES", "HTML", + "REACT", "SASS", "STIMULUS", "SVELTE", "TAILWIND_CSS", "TWIG", "VANILLA_JS", "VUE", + "WEB_COMPONENTS")), + /* + DESIGN_TOKEN: λ””μžμΈ 토큰, ICON: μ•„μ΄μ½˜, OPENSOURCE: μ˜€ν”ˆμ†ŒμŠ€, EXAMPLE: μš©λ‘€, + BRAND_PRINCIPLES: λΈŒλžœλ“œ 원칙, ACCESSIBILITY_INFORMATION: μ ‘κ·Όμ„± μ•ˆλ‚΄, + VOICE_AND_TONE: λ³΄μ΄μŠ€μ™€ 톀, CODE_EXAMPLE: μ½”λ“œ 예제 + */ + CONTENT(List.of("DESIGN_TOKEN", "ICON", "OPENSOURCE", "EXAMPLE", "BRAND_PRINCIPLES", + "ACCESSIBILITY_INFORMATION", "VOICE_AND_TONE", "CODE_EXAMPLE")), DEVICE(List.of("DESKTOP", "MOBILE")); private final List values; diff --git a/src/main/java/ject/componote/domain/design/domain/link/LinkType.java b/src/main/java/ject/componote/domain/design/domain/link/LinkType.java index e6a87457..f670f2b3 100644 --- a/src/main/java/ject/componote/domain/design/domain/link/LinkType.java +++ b/src/main/java/ject/componote/domain/design/domain/link/LinkType.java @@ -5,6 +5,9 @@ public enum LinkType { FIGMA("^https://www\\.figma\\.com/.+"), SLACK("^https://[a-zA-Z0-9]+\\.slack\\.com/.+"), CODE_PEN("^https://codepen\\.io/.+"), + WEBSITE(".*"), + ZEROHEIGHT("^https://base\\.uber\\.com/.+"), + STORYBOOK("^https://[a-zA-Z0-9.-]+\\.storybook\\.com/.+|^https://[a-zA-Z0-9.-]+\\.delldesignsystem\\.com/.+"), ETC(".*"); // ETCλŠ” λͺ¨λ“  URL ν—ˆμš© private final String regex;