Class EventPostGetService
java.lang.Object
io.github.navjotsrakhra.eventmanager.service.EventPostGetService
The EventPostGetService class provides methods for retrieving EventPost entities from the repository.
-
Constructor Summary
ConstructorsConstructorDescriptionEventPostGetService(EventPostRepository repository) Constructor for the EventPostGetService class. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<List<EventPostDTO>> Deprecated.org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<EventPostAdminDTO>> getAllPostsWithPagination(org.springframework.data.domain.Pageable pageable) Get a list of all event posts with pagination.org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<EventPostDTO>> getPostsWithPagination(org.springframework.data.domain.Pageable pageable) Get a list of all event posts with pagination.org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<EventPostDTO>> getPostsWithPaginationOfUser(org.springframework.data.domain.Pageable pageable, Principal principal) Get a list of all event posts with pagination posted by the specified user.
-
Constructor Details
-
Method Details
-
getAllPosts
Deprecated.UsegetPostsWithPagination(Pageable)instead.Get a list of all event posts.- Returns:
- ResponseEntity containing a list of EventPostDTO objects.
-
getPostsWithPagination
public org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<EventPostDTO>> getPostsWithPagination(org.springframework.data.domain.Pageable pageable) Get a list of all event posts with pagination. SeePageable. Defaults to page 0, size 5, sorted by postedAt.- Parameters:
pageable- The pagination object. SeePageable.- Returns:
- ResponseEntity containing a list of EventPostDTO objects.
-
getPostsWithPaginationOfUser
public org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<EventPostDTO>> getPostsWithPaginationOfUser(org.springframework.data.domain.Pageable pageable, Principal principal) Get a list of all event posts with pagination posted by the specified user. SeePageable. Defaults to page 0, size 5, sorted by postedAt.- Parameters:
pageable- The pagination object. SeePageable.principal- The Principal object containing the username of the user making the request.- Returns:
- ResponseEntity containing a list of EventPostDTO objects.
-
getAllPostsWithPagination
public org.springframework.http.ResponseEntity<org.springframework.data.domain.Page<EventPostAdminDTO>> getAllPostsWithPagination(org.springframework.data.domain.Pageable pageable) Get a list of all event posts with pagination. SeePageable. Defaults to page 0, size 5, sorted by postedAt. This method is intended for use by administrators.- Parameters:
pageable- The pagination object. SeePageable.- Returns:
- ResponseEntity containing a list of EventPostAdminDTO objects.
-
getPostsWithPagination(Pageable)instead.