Class PostSvc

java.lang.Object
com.patreonshout.rest.BaseSvc
com.patreonshout.rest.PostSvc
All Implemented Interfaces:
PostImpl

@RestController
public class PostSvc
extends BaseSvc
implements PostImpl
Post RESTful Endpoint Interface
  • Field Summary

    Fields
    Modifier and Type Field Description
    (package private) PostsRepository postsRepository
    An autowired Spring component that endpoints utilize to send or receive data from the posts table in the database
    private WebAccountFunctions webAccountFunctions
    An autowired Spring component that endpoints utilize to send or receive data from the database
  • Constructor Summary

    Constructors
    Constructor Description
    PostSvc()  
  • Method Summary

    Modifier and Type Method Description
    org.springframework.http.ResponseEntity<?> GetCreatorPosts​(int campaignId)
    Endpoint that will get a list of PostBean objects from the database given a specified creator
    org.springframework.http.ResponseEntity<?> GetMultipleCreatorPosts​(PostGetMultipleRequest postGetMultipleRequest)
    Endpoint that will get a list of PostBean objects from the database given list of creators

    Methods inherited from class com.patreonshout.rest.BaseSvc

    catchCustomException, catchSQLIntegrityConstraintViolationException

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • postsRepository

      @Autowired PostsRepository postsRepository
      An autowired Spring component that endpoints utilize to send or receive data from the posts table in the database
    • webAccountFunctions

      @Autowired private WebAccountFunctions webAccountFunctions
      An autowired Spring component that endpoints utilize to send or receive data from the database
  • Constructor Details

    • PostSvc

      public PostSvc()
  • Method Details

    • GetCreatorPosts

      public org.springframework.http.ResponseEntity<?> GetCreatorPosts​(@RequestParam(name="campaign") int campaignId)
      Endpoint that will get a list of PostBean objects from the database given a specified creator
      Specified by:
      GetCreatorPosts in interface PostImpl
      Parameters:
      campaignId - is the creator of the posts we want to get
      Returns:
      a json body of post objects from a given creator
    • GetMultipleCreatorPosts

      public org.springframework.http.ResponseEntity<?> GetMultipleCreatorPosts​(@RequestBody PostGetMultipleRequest postGetMultipleRequest) throws PSException
      Endpoint that will get a list of PostBean objects from the database given list of creators
      Specified by:
      GetMultipleCreatorPosts in interface PostImpl
      Parameters:
      postGetMultipleRequest - is the PostGetMultipleRequest object holding json data about our request
      Returns:
      a json body of post objects from the given list of creators
      Throws:
      PSException