Package com.patreonshout.rest.interfaces
Interface ListImpl
- All Known Implementing Classes:
ListSvc
@RequestMapping("/lists")
public interface ListImpl
Interface for endpoints relating to lists
-
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<?>AddPostToFavoritesList(FavoriteListRequest favoriteListAddRequest)Adds a post to the favorites listorg.springframework.http.ResponseEntity<?>AddUserList(ListCreationRequest listCreationRequest)Endpoint that will add a newListBeanobject to the databaseorg.springframework.http.ResponseEntity<?>DeletePostFromFavoritesList(FavoriteListRequest favoriteListDeleteRequest)Deletes a post from the favorites listorg.springframework.http.ResponseEntity<?>DeleteUserList(ListDeleteRequest listDeleteRequest)Endpoint that will delete aListBeanobject in the databaseorg.springframework.http.ResponseEntity<?>GetPostsFromList(java.lang.String loginToken, int list_id)Gets the post from a specific list for a specific userorg.springframework.http.ResponseEntity<?>GetUserLists(java.lang.String loginToken)Endpoint that will get a list ofListBeanobjects from the database given a login tokenorg.springframework.http.ResponseEntity<?>GetUserListsWithPost(java.lang.String loginToken, java.lang.String url)Endpoint that will get a list ofListBeanobjects from the database that have a specific post in themorg.springframework.http.ResponseEntity<?>UpdateUserList(ListUpdateRequest listUpdateRequest)Endpoint that will update aListBeanobject in the databaseorg.springframework.http.ResponseEntity<?>UpdateUserPostLists(ListPostUpdateRequest listPostUpdateRequest)Updates the user's post lists
-
Method Details
-
GetUserLists
@GetMapping("/user") org.springframework.http.ResponseEntity<?> GetUserLists(@RequestParam(required=true,name="loginToken") java.lang.String loginToken) throws PSExceptionEndpoint that will get a list ofListBeanobjects from the database given a login token- Parameters:
loginToken- is the login token provided to the user upon sign in- Returns:
- a json body of list objects for a user
- Throws:
PSException
-
GetUserListsWithPost
@GetMapping("/post") org.springframework.http.ResponseEntity<?> GetUserListsWithPost(@RequestParam(name="loginToken") java.lang.String loginToken, @RequestParam(name="url") java.lang.String url) throws PSExceptionEndpoint that will get a list ofListBeanobjects from the database that have a specific post in them- Parameters:
loginToken- is the login token provided to the user upon sign inurl- is the url of the post we want to get the lists of- Returns:
- a json body of list objects for a user
- Throws:
PSException
-
AddUserList
@PostMapping("/list") org.springframework.http.ResponseEntity<?> AddUserList(@RequestBody ListCreationRequest listCreationRequest) throws PSExceptionEndpoint that will add a newListBeanobject to the database- Parameters:
listCreationRequest- is theListCreationRequestobject that containsListBeanrequest parameters- Returns:
HttpStatus.CREATEDif successful,HttpStatus.CONFLICTotherwise- Throws:
PSException
-
UpdateUserList
@PutMapping("/list") org.springframework.http.ResponseEntity<?> UpdateUserList(@RequestBody ListUpdateRequest listUpdateRequest)Endpoint that will update aListBeanobject in the database- Parameters:
listUpdateRequest- is theListUpdateRequestobject that containsListBeanrequest parameters- Returns:
HttpStatus.OKif successful,HttpStatus.BAD_REQUESTotherwise
-
DeleteUserList
@DeleteMapping("/list") org.springframework.http.ResponseEntity<?> DeleteUserList(@RequestBody ListDeleteRequest listDeleteRequest) throws PSExceptionEndpoint that will delete aListBeanobject in the database- Parameters:
listDeleteRequest- is theListDeleteRequestobject that containsListBeanrequests parameters- Returns:
HttpStatus.OKif successful,HttpStatus.BAD_REQUESTotherwise- Throws:
PSException
-
UpdateUserPostLists
@PutMapping("/post") org.springframework.http.ResponseEntity<?> UpdateUserPostLists(@RequestBody ListPostUpdateRequest listPostUpdateRequest) throws PSExceptionUpdates the user's post lists- Parameters:
listPostUpdateRequest- is theListPostUpdateRequestobject that containsListPostrequests parameters- Returns:
HttpStatus.OKif successful,HttpStatus.BAD_REQUESTotherwise- Throws:
PSException
-
GetPostsFromList
@GetMapping("list") org.springframework.http.ResponseEntity<?> GetPostsFromList(@RequestParam(name="loginToken") java.lang.String loginToken, @RequestParam(name="list_id") int list_id) throws PSExceptionGets the post from a specific list for a specific user- Parameters:
loginToken- is the login token provided to the user upon sign inlist_id- is the id of the list we want to get the posts of- Returns:
- a list of
PostBeanobjects from the specified list_id - Throws:
PSException
-
AddPostToFavoritesList
@PostMapping("/favorite") org.springframework.http.ResponseEntity<?> AddPostToFavoritesList(@RequestBody FavoriteListRequest favoriteListAddRequest) throws PSExceptionAdds a post to the favorites list- Parameters:
favoriteListAddRequest- is theFavoriteListRequestobject that containsListPostrequests parameters- Returns:
HttpStatus.CREATEDif successful,HttpStatus.CONFLICTORHttpStatus.BAD_REQUESTotherwise- Throws:
PSException
-
DeletePostFromFavoritesList
@DeleteMapping("/favorite") org.springframework.http.ResponseEntity<?> DeletePostFromFavoritesList(@RequestBody FavoriteListRequest favoriteListDeleteRequest) throws PSExceptionDeletes a post from the favorites list- Parameters:
favoriteListDeleteRequest- is theFavoriteListRequestobject that containsListPostrequests parameters- Returns:
HttpStatus.CREATEDif successful,HttpStatus.BAD_REQUESTotherwise- Throws:
PSException
-