feat: Add dateUpdated field to Post model and update PostController #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to the
Post
class,PostController
class,PostRepository
interface, andPostTest
class in thecom.liatrio.dojo.devopsknowledgeshareapi
package. The most significant changes include the addition of adateUpdated
field in thePost
class, a newPUT
request method in thePostController
class, new search methods in thePostRepository
interface, and new test cases in thePostTest
class.Changes to the
Post
class:src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/Post.java
: Added a newdateUpdated
field with its respective setter and getter methods. This allows posts to track their last update time.Changes to the
PostController
class:src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostController.java
: Added a newPUT
request methodputPost
, which updates an existing post with the provided id. If the post does not exist, it throws anIllegalArgumentException
.Changes to the
PostRepository
interface:src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostRepository.java
: Added new methodsfindByTitle
,findByFirstName
, andfindByLink
to allow searching posts by title, first name, and link respectively.Changes to the
PostTest
class:src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/PostTest.java
: Added new test cases to validate the newdateUpdated
field in thePost
class, the link validation logic, and the date format. [1] [2]