This file contains hidden or 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
| @RestController | |
| @RequestMapping(value = "/items") | |
| public class ItemController { | |
| private final ItemService itemService; | |
| private final ItemMapper itemMapper; | |
| ... | |
| @ApiOperation("Update an existing item") |
This file contains hidden or 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
| @Service | |
| @RequiredArgsConstructor | |
| public class ItemService { | |
| private final ItemRepository itemRepository; | |
| private final ItemTagRepository itemTagRepository; | |
| ... | |
| @Transactional |
This file contains hidden or 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
| @RestController | |
| @RequestMapping(value = "/items") | |
| public class ItemController { | |
| private final ItemService itemService; | |
| ... | |
| @ApiOperation("Delete an item") | |
| @DeleteMapping("/{id}") |
This file contains hidden or 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
| @Service | |
| @RequiredArgsConstructor | |
| public class ItemService { | |
| private final ItemRepository itemRepository; | |
| ... | |
| /** | |
| * Find an item |
This file contains hidden or 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
| @RestController | |
| @RequestMapping(value = "/items") | |
| public class ItemController { | |
| private final ItemService itemService; | |
| private final ItemMapper itemMapper; | |
| ... | |
| @ApiOperation("Find an item by its id") |
This file contains hidden or 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
| @Repository | |
| public interface TagRepository extends ReactiveSortingRepository<Tag, Long> { | |
| @Query("select t.* from tag t join item_tag it on t.id = it.tag_id where it.item_id = :item_id order by t.name") | |
| Flux<Tag> findTagsByItemId(Long itemId); | |
| } |
This file contains hidden or 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
| @Service | |
| @RequiredArgsConstructor | |
| public class ItemService { | |
| private static final Sort DEFAULT_SORT = Sort.by(Sort.Order.by("lastModifiedDate")); | |
| private final NotificationService notificationService; | |
| private final ItemRepository itemRepository; | |
| private final PersonRepository personRepository; |
This file contains hidden or 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
| @Data | |
| @Accessors(chain = true) | |
| public class ItemResource { | |
| private Long id; | |
| private Long version; | |
| private String description; | |
| private ItemStatus status; |
This file contains hidden or 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
| @RestController | |
| @RequestMapping(value = "/items") | |
| public class ItemController { | |
| private final ItemService itemService; | |
| private final ItemMapper itemMapper; | |
| ... | |
| @ApiOperation("Get the list of items") |
This file contains hidden or 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
| spring.r2dbc.url=r2dbc:postgresql:////127.0.0.1:5432/todolist | |
| spring.r2dbc.username=admin | |
| spring.r2dbc.password=password |