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) PostsRepositorypostsRepositoryAn autowired Spring component that endpoints utilize to send or receive data from the posts table in the databaseprivate WebAccountFunctionswebAccountFunctionsAn 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 ofPostBeanobjects from the database given a specified creatororg.springframework.http.ResponseEntity<?>GetMultipleCreatorPosts(PostGetMultipleRequest postGetMultipleRequest)Endpoint that will get a list ofPostBeanobjects from the database given list of creatorsMethods inherited from class com.patreonshout.rest.BaseSvc
catchCustomException, catchSQLIntegrityConstraintViolationExceptionMethods 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 ofPostBeanobjects from the database given a specified creator- Specified by:
GetCreatorPostsin 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 ofPostBeanobjects from the database given list of creators- Specified by:
GetMultipleCreatorPostsin interfacePostImpl- Parameters:
postGetMultipleRequest- is thePostGetMultipleRequestobject holding json data about our request- Returns:
- a json body of post objects from the given list of creators
- Throws:
PSException
-