-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
213 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 10 additions & 12 deletions
22
src/main/java/org/kakaoshare/backend/domain/category/dto/CategoryHeaderResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
src/main/java/org/kakaoshare/backend/domain/category/dto/SimpleCategoryDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
package org.kakaoshare.backend.domain.category.dto; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.category.entity.Category; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class SimpleCategoryDto { | ||
private final Long categoryId; | ||
private final String categoryName; | ||
private Long categoryId; | ||
private String categoryName; | ||
|
||
@Builder | ||
private SimpleCategoryDto(Long categoryId, String categoryName) { | ||
@QueryProjection | ||
public SimpleCategoryDto(Long categoryId, String categoryName) { | ||
this.categoryId = categoryId; | ||
this.categoryName = categoryName; | ||
} | ||
public static SimpleCategoryDto from(final Category category){ | ||
|
||
public static SimpleCategoryDto from(final CategoryDto categoryDto) { | ||
return SimpleCategoryDto.builder() | ||
.categoryId(category.getCategoryId()) | ||
.categoryName(category.getName()) | ||
.categoryId(categoryDto.getCategoryId()) | ||
.categoryName(categoryDto.getCategoryName()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
...ava/org/kakaoshare/backend/domain/category/repository/query/CategoryRepositoryCustom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package org.kakaoshare.backend.domain.category.repository.query; | ||
|
||
import org.kakaoshare.backend.domain.category.entity.Category; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import org.kakaoshare.backend.domain.category.dto.CategoryDto; | ||
import org.kakaoshare.backend.domain.category.dto.SimpleCategoryDto; | ||
|
||
public interface CategoryRepositoryCustom { | ||
|
||
Optional<CategoryDto> findParentCategoryWithChildren(Long categoryId); | ||
|
||
Optional<Category> findParentCategoryWithChildren(Long categoryId); | ||
|
||
Optional<Category> findChildCategoryWithParentCheck(final Long categoryId, final Long subcategoryId); | ||
Optional<CategoryDto> findChildCategoryWithParentCheck(final Long categoryId, final Long subcategoryId); | ||
|
||
|
||
List<Category> findAllParentCategories(); | ||
List<CategoryDto> findAllParentCategories(); | ||
Long countBrand(Long categoryId); | ||
Long countProduct(Long categoryId); | ||
|
||
|
||
List<SimpleCategoryDto> findChildrenCategory(Long categoryId); | ||
} |
Oops, something went wrong.