Class EventPostGetService

java.lang.Object
io.github.navjotsrakhra.eventmanager.service.EventPostGetService

@Service public class EventPostGetService extends Object
The EventPostGetService class provides methods for retrieving EventPost entities from the repository.
  • Constructor Details

    • EventPostGetService

      public EventPostGetService(EventPostRepository repository)
      Constructor for the EventPostGetService class.
      Parameters:
      repository - The JpaRepository used for retrieving event posts.
  • Method Details

    • getAllPosts

      @Deprecated public org.springframework.http.ResponseEntity<List<EventPostDTO>> getAllPosts()
      Deprecated.
      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. See Pageable. Defaults to page 0, size 5, sorted by postedAt.
      Parameters:
      pageable - The pagination object. See Pageable.
      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. See Pageable. Defaults to page 0, size 5, sorted by postedAt.
      Parameters:
      pageable - The pagination object. See Pageable.
      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. See Pageable. Defaults to page 0, size 5, sorted by postedAt. This method is intended for use by administrators.
      Parameters:
      pageable - The pagination object. See Pageable.
      Returns:
      ResponseEntity containing a list of EventPostAdminDTO objects.