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 newListBean
object 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 aListBean
object 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 ofListBean
objects 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 ofListBean
objects from the database that have a specific post in themorg.springframework.http.ResponseEntity<?>
UpdateUserList(ListUpdateRequest listUpdateRequest)
Endpoint that will update aListBean
object 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 ofListBean
objects 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 ofListBean
objects 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 newListBean
object to the database- Parameters:
listCreationRequest
- is theListCreationRequest
object that containsListBean
request parameters- Returns:
HttpStatus.CREATED
if successful,HttpStatus.CONFLICT
otherwise- Throws:
PSException
-
UpdateUserList
@PutMapping("/list") org.springframework.http.ResponseEntity<?> UpdateUserList(@RequestBody ListUpdateRequest listUpdateRequest)Endpoint that will update aListBean
object in the database- Parameters:
listUpdateRequest
- is theListUpdateRequest
object that containsListBean
request parameters- Returns:
HttpStatus.OK
if successful,HttpStatus.BAD_REQUEST
otherwise
-
DeleteUserList
@DeleteMapping("/list") org.springframework.http.ResponseEntity<?> DeleteUserList(@RequestBody ListDeleteRequest listDeleteRequest) throws PSExceptionEndpoint that will delete aListBean
object in the database- Parameters:
listDeleteRequest
- is theListDeleteRequest
object that containsListBean
requests parameters- Returns:
HttpStatus.OK
if successful,HttpStatus.BAD_REQUEST
otherwise- Throws:
PSException
-
UpdateUserPostLists
@PutMapping("/post") org.springframework.http.ResponseEntity<?> UpdateUserPostLists(@RequestBody ListPostUpdateRequest listPostUpdateRequest) throws PSExceptionUpdates the user's post lists- Parameters:
listPostUpdateRequest
- is theListPostUpdateRequest
object that containsListPost
requests parameters- Returns:
HttpStatus.OK
if successful,HttpStatus.BAD_REQUEST
otherwise- 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
PostBean
objects 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 theFavoriteListRequest
object that containsListPost
requests parameters- Returns:
HttpStatus.CREATED
if successful,HttpStatus.CONFLICT
ORHttpStatus.BAD_REQUEST
otherwise- Throws:
PSException
-
DeletePostFromFavoritesList
@DeleteMapping("/favorite") org.springframework.http.ResponseEntity<?> DeletePostFromFavoritesList(@RequestBody FavoriteListRequest favoriteListDeleteRequest) throws PSExceptionDeletes a post from the favorites list- Parameters:
favoriteListDeleteRequest
- is theFavoriteListRequest
object that containsListPost
requests parameters- Returns:
HttpStatus.CREATED
if successful,HttpStatus.BAD_REQUEST
otherwise- Throws:
PSException
-