Set up parent category mechanism.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.codiki.exposition.category;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.springframework.http.HttpStatus.CREATED;
|
||||
@@ -9,6 +10,7 @@ import org.codiki.domain.category.model.Category;
|
||||
import org.codiki.exposition.category.model.CategoryDto;
|
||||
import org.codiki.exposition.category.model.CategoryEditionRequest;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@@ -51,4 +53,12 @@ public class CategoryController {
|
||||
public void deleteCategory(@PathVariable("categoryId") UUID categoryId) {
|
||||
categoryUseCases.deleteCategory(categoryId);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public List<CategoryDto> getAllCategories() {
|
||||
return categoryUseCases.getAll()
|
||||
.stream()
|
||||
.map(CategoryDto::new)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ public class SecurityConfiguration {
|
||||
.requestMatchers(
|
||||
GET,
|
||||
"/api/health/check",
|
||||
"/api/categories",
|
||||
"/error"
|
||||
).permitAll()
|
||||
.requestMatchers(
|
||||
|
||||
Reference in New Issue
Block a user