-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from taco-official/KL-163/프론트-요구사항-처리
feat(KL-163): handle fe requirements
- Loading branch information
Showing
108 changed files
with
863 additions
and
1,740 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
29 changes: 29 additions & 0 deletions
29
src/main/java/taco/klkl/domain/category/controller/subcategory/SubcategoryController.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package taco.klkl.domain.category.controller.subcategory; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import taco.klkl.domain.category.dto.response.subcategory.SubcategoryHierarchyResponse; | ||
import taco.klkl.domain.category.service.subcategory.SubcategoryService; | ||
|
||
@Slf4j | ||
@RestController | ||
@Tag(name = "6. 카테고리", description = "카테고리 관련 API") | ||
@RequestMapping("/v1/subcategories") | ||
@RequiredArgsConstructor | ||
public class SubcategoryController { | ||
|
||
private final SubcategoryService subcategoryService; | ||
|
||
@GetMapping("/{subcategoryId}/hierarchy") | ||
@Operation(summary = "특정 소분류의 계층 정보 조회", description = "특정 소분류의 계층 정보를 조회합니다.") | ||
public SubcategoryHierarchyResponse getSubcategoryHierarchy(@PathVariable final Long subcategoryId) { | ||
return subcategoryService.findSubcategoryHierarchyById(subcategoryId); | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
src/main/java/taco/klkl/domain/category/controller/tag/TagController.java
This file was deleted.
Oops, something went wrong.
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
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
18 changes: 18 additions & 0 deletions
18
...java/taco/klkl/domain/category/dto/response/subcategory/SubcategoryHierarchyResponse.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package taco.klkl.domain.category.dto.response.subcategory; | ||
|
||
import taco.klkl.domain.category.domain.category.Category; | ||
import taco.klkl.domain.category.domain.subcategory.Subcategory; | ||
|
||
public record SubcategoryHierarchyResponse( | ||
Long subcategoryId, | ||
Long categoryId | ||
) { | ||
public static SubcategoryHierarchyResponse from(final Subcategory subcategory) { | ||
final Category category = subcategory.getCategory(); | ||
|
||
return new SubcategoryHierarchyResponse( | ||
subcategory.getId(), | ||
category.getId() | ||
); | ||
} | ||
} |
18 changes: 16 additions & 2 deletions
18
src/main/java/taco/klkl/domain/category/dto/response/subcategory/SubcategoryResponse.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,12 +1,26 @@ | ||
package taco.klkl.domain.category.dto.response.subcategory; | ||
|
||
import java.util.List; | ||
|
||
import taco.klkl.domain.category.domain.SubcategoryTag; | ||
import taco.klkl.domain.category.domain.subcategory.Subcategory; | ||
import taco.klkl.domain.category.dto.response.tag.TagResponse; | ||
|
||
public record SubcategoryResponse( | ||
Long id, | ||
String name | ||
String name, | ||
List<TagResponse> tags | ||
) { | ||
public static SubcategoryResponse from(final Subcategory subcategory) { | ||
return new SubcategoryResponse(subcategory.getId(), subcategory.getName()); | ||
final List<TagResponse> tags = subcategory.getSubcategoryTags().stream() | ||
.map(SubcategoryTag::getTag) | ||
.map(TagResponse::from) | ||
.toList(); | ||
|
||
return new SubcategoryResponse( | ||
subcategory.getId(), | ||
subcategory.getName(), | ||
tags | ||
); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
src/main/java/taco/klkl/domain/category/service/SubcategoryTagService.java
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
src/main/java/taco/klkl/domain/category/service/SubcategoryTagServiceImpl.java
This file was deleted.
Oops, something went wrong.
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
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
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
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
10 changes: 10 additions & 0 deletions
10
src/main/java/taco/klkl/domain/comment/exception/CommentUserNotMatchException.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package taco.klkl.domain.comment.exception; | ||
|
||
import taco.klkl.global.error.exception.CustomException; | ||
import taco.klkl.global.error.exception.ErrorCode; | ||
|
||
public class CommentUserNotMatchException extends CustomException { | ||
public CommentUserNotMatchException() { | ||
super(ErrorCode.COMMENT_USER_NOT_MATCH); | ||
} | ||
} |
Oops, something went wrong.