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.
Implement Subforum Endpoints
Overview
This pull request introduces the implementation of two new endpoints for managing and retrieving subforum data:
/subforums/searchKeyword
/subforum/{id}
These endpoints provide functionality for searching subforums by keyword and retrieving detailed subforum information, respectively.
Endpoints Added
1.
/subforums/searchKeyword
Description: Searches for subforums with titles containing a given keyword.
Input:
keyword
(query parameter): The keyword to search for in subforum titles.Output: Returns a list of subforums matching the keyword with the following details:
id
: Subforum ID.title
: Subforum title.numberOfPosts
: Number of posts in the subforum.Success Response Example:
2.
/subforum/{id}
Description: Retrieves detailed information about a specific subforum by ID.
Input:
id
(path parameter): The ID of the subforum.username
(query parameter): The username to determine if the user is following the subforum.Output: Returns detailed information about the subforum, including:
subforumName
: The name of the subforum.isFollowedByGivenUsername
: Whether the given username is following the subforum.posts
: A list of posts in the subforum, each containing:postID
: Post ID.title
: Post title.content
: Post content.creatorUsername
: The username of the post creator.creatorProfilePhoto
: The profile photo of the post creator.nofLikes
: Number of likes on the post.creationDate
: Post creation date.nofComments
: Number of comments on the post.numberOfPosts
: Total number of posts in the subforum.numberOfFollowers
: Total number of followers for the subforum.Success Response Example:
Error Response Example (Subforum Not Found):
Key Changes
SubforumDetailsDTO
andPostSummaryDTO
for structured API responses./subforums/searchKeyword
and/subforum/{id}
with validation and query parameter handling.Testing
/subforums/searchKeyword
./subforum/{id}
.Notes
/subforum/{id}
if subforums have many posts.Checklist
This pull request provides the functionality for searching and retrieving subforum data efficiently. Let me know if further details or refinements are needed!