Skip to content
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

feat: Add dateUpdated field to Post model and create InfoController #27

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mitchell-liatrio
Copy link

This pull request includes significant updates to the com.liatrio.dojo.devopsknowledgeshareapi package, introducing a new controller, extending the functionality of existing controllers and repositories, and adding comprehensive tests. The most important changes are summarized below:

New Controller:

  • InfoController.java: Introduced a new InfoController class with a /info endpoint that logs requests and returns a welcome message.

Enhancements to Existing Functionality:

  • PostController.java: Added new endpoints to handle GET requests by title and PUT requests for updating posts. Fixed a typo in log messages.
  • PostRepository.java: Added a method to find posts by title.

Model Updates:

  • Post.java: Added dateUpdated field with corresponding getter and setter methods.

Testing:

  • InfoControllerTest.java: Added tests for the new InfoController to verify the /info endpoint functionality.
  • PostTest.java: Added tests for the new dateUpdated field and validation methods in the Post class.

return repository.findAll().stream().collect(Collectors.toList());
}

@GetMapping("/posts/title/{title}")
public Collection<Post> getPostsByTitle(@PathVariable("title") String title) {
log.info("{}: received a GET request for posts with title: {}", deploymentType, title);

Check failure

Code scanning / CodeQL

Log Injection High

This log entry depends on a
user-provided value
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant