-
Notifications
You must be signed in to change notification settings - Fork 29
Daniel Boyce Feat/lesson 23/api intro adds endpoints get post and deleting media items in class #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Daniel Boyce Feat/lesson 23/api intro adds endpoints get post and deleting media items in class #742
Conversation
…into feat/lesson-23/api-intro
…s logic using library to get the media item by id
…s check if the added item is null to return an error status
…tic functions to convert it to a media item
…s logic using library to get the media item by id
|
My pr added stuff from another assignment, not sure how it happend, working on a fix now |
…s check if the added item is null to return an error status
anthonydmays
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎓 Automated Grading Report
Student: Daniel Boyce
Date: 10/7/2025
Feedback
The submission demonstrates a good understanding of the functional requirements. The student has implemented the necessary endpoints in the MediaItemsController.java file, including GET, POST, and DELETE operations. The logic for handling media items by ID is correctly implemented, and the use of ResponseEntity for HTTP responses is appropriate. However, there are some discrepancies compared to the sample solution, such as the use of Optional and the handling of exceptions, which could be improved for consistency and clarity.
On the technical side, the code is mostly well-formatted and syntactically correct. The use of imports and annotations is appropriate. However, there are minor issues, such as the unnecessary addition of a newline in MediaItemRequest.java, which could be avoided to maintain clean code. Additionally, the use of wildcard (<?>) in the addItem method could be more specific to improve type safety.
Overall, the submission meets most of the requirements but could benefit from slight improvements in consistency and adherence to best practices.
This is an automated preliminary review. Please review and adjust before finalizing.
| private int runtime; | ||
|
|
||
| public static MediaItem asMediaItem(MediaItemRequest request) { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line break
Still a work in progress, but I was able to finish the GET mapping for get by id, and the post mapping works in Postman, but gets an error when I run the tests.
I was able to finish the post mapping add item method. I got a little confused about how the createRequests and mediaItemRequests classes worked and where they should be used.