Package com.patreonshout.rest
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 databaseprivate 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 ofPostBean
objects from the database given a specified creatororg.springframework.http.ResponseEntity<?>
GetMultipleCreatorPosts(PostGetMultipleRequest postGetMultipleRequest)
Endpoint that will get a list ofPostBean
objects from the database given list of creatorsMethods 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
An autowired Spring component that endpoints utilize to send or receive data from the posts table in the database -
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 ofPostBean
objects from the database given a specified creator- Specified by:
GetCreatorPosts
in interfacePostImpl
- 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 PSExceptionEndpoint that will get a list ofPostBean
objects from the database given list of creators- Specified by:
GetMultipleCreatorPosts
in interfacePostImpl
- Parameters:
postGetMultipleRequest
- is thePostGetMultipleRequest
object holding json data about our request- Returns:
- a json body of post objects from the given list of creators
- Throws:
PSException
-