Skip to content

Commit 035b0c9

Browse files
author
Mohamed
committed
Fix: changed formating
1 parent 2fe9251 commit 035b0c9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lesson_16/api/api_app/src/main/java/com/codedifferently/lesson16/web/MediaItemsController.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import java.util.UUID;
1212
import org.springframework.http.HttpStatus;
1313
import org.springframework.http.ResponseEntity;
14-
import org.springframework.web.bind.annotation.DeleteMapping;
1514
import org.springframework.web.bind.annotation.CrossOrigin;
15+
import org.springframework.web.bind.annotation.DeleteMapping;
1616
import org.springframework.web.bind.annotation.GetMapping;
1717
import org.springframework.web.bind.annotation.PathVariable;
1818
import org.springframework.web.bind.annotation.PostMapping;
@@ -34,15 +34,19 @@ public MediaItemsController(Library library) throws IOException {
3434
this.library = library;
3535
this.librarian = library.getLibrarians().stream().findFirst().orElseThrow();
3636
}
37-
3837
@GetMapping("/items")
3938
public GetMediaItemsResponse getItems() {
4039
Set<MediaItem> items = library.search(SearchCriteria.builder().build());
4140
List<MediaItemResponse> responseItems = items.stream().map(MediaItemResponse::from).toList();
4241
var response = GetMediaItemsResponse.builder().items(responseItems).build();
4342
return response;
4443
}
45-
44+
/**
45+
* Post an item to the specified endpoint.
46+
*
47+
* @param req the request object for creating a media item
48+
* @return the response object for creating a media item
49+
*/
4650
@PostMapping("/items")
4751
public CreateMediaItemResponse postItem(@Valid @RequestBody CreateMediaItemRequest req) {
4852
MediaItem media = MediaItemRequest.asMediaItem(req.getItem());

0 commit comments

Comments
 (0)