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 findByTitle, findByFirstName, and findByLink methods to Pos… #28

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

Conversation

baserrato
Copy link

This pull request introduces several new features and enhancements to the devopsknowledgeshareapi. The most significant changes include the addition of a new InfoController, updates to the Post class and PostController for handling new endpoints and fields, and the implementation of corresponding tests.

New Features:

  • InfoController: Added a new controller to handle /info endpoint requests. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/InfoController.java)

Enhancements to Post Class:

  • New Field and Methods: Added dateUpdated field with corresponding getter and setter methods. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/Post.java)

Enhancements to PostController:

  • New Endpoints: Introduced new endpoints to fetch posts by title, first name, and link, and to update posts. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostController.java) [1] [2]

Repository Changes:

  • New Methods: Added methods to PostRepository to support the new endpoints in PostController. (src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostRepository.java)

Tests:

  • InfoControllerTest: Added tests for the new InfoController. (src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/InfoControllerTest.java)
  • PostTest: Added tests for the new dateUpdated field in the Post class. (src/test/java/com/liatrio/dojo/devopsknowledgeshareapi/PostTest.java)

@@ -25,6 +30,24 @@
return repository.findAll().stream().collect(Collectors.toList());
}

@GetMapping("/posts/title/{title}")
public List<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
.

@GetMapping("/posts/firstname/{firstName}")
public List<Post> getPostsByFirstName(@PathVariable("firstName") String firstName) {
log.info("{}: received a GET request for posts with first name {}", deploymentType, firstName);

Check failure

Code scanning / CodeQL

Log Injection High

This log entry depends on a
user-provided value
.

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

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