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 list
    org.springframework.http.ResponseEntity<?> AddUserList​(ListCreationRequest listCreationRequest)
    Endpoint that will add a new ListBean object to the database
    org.springframework.http.ResponseEntity<?> DeletePostFromFavoritesList​(FavoriteListRequest favoriteListDeleteRequest)
    Deletes a post from the favorites list
    org.springframework.http.ResponseEntity<?> DeleteUserList​(ListDeleteRequest listDeleteRequest)
    Endpoint that will delete a ListBean object in the database
    org.springframework.http.ResponseEntity<?> GetPostsFromList​(java.lang.String loginToken, int list_id)
    Gets the post from a specific list for a specific user
    org.springframework.http.ResponseEntity<?> GetUserLists​(java.lang.String loginToken)
    Endpoint that will get a list of ListBean objects from the database given a login token
    org.springframework.http.ResponseEntity<?> GetUserListsWithPost​(java.lang.String loginToken, java.lang.String url)
    Endpoint that will get a list of ListBean objects from the database that have a specific post in them
    org.springframework.http.ResponseEntity<?> UpdateUserList​(ListUpdateRequest listUpdateRequest)
    Endpoint that will update a ListBean object in the database
    org.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 PSException
      Endpoint that will get a list of ListBean 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 PSException
      Endpoint that will get a list of ListBean objects from the database that have a specific post in them
      Parameters:
      loginToken - is the login token provided to the user upon sign in
      url - 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 PSException
      Endpoint that will add a new ListBean object to the database
      Parameters:
      listCreationRequest - is the ListCreationRequest object that contains ListBean 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 a ListBean object in the database
      Parameters:
      listUpdateRequest - is the ListUpdateRequest object that contains ListBean request parameters
      Returns:
      HttpStatus.OK if successful, HttpStatus.BAD_REQUEST otherwise
    • DeleteUserList

      @DeleteMapping("/list") org.springframework.http.ResponseEntity<?> DeleteUserList​(@RequestBody ListDeleteRequest listDeleteRequest) throws PSException
      Endpoint that will delete a ListBean object in the database
      Parameters:
      listDeleteRequest - is the ListDeleteRequest object that contains ListBean 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 PSException
      Updates the user's post lists
      Parameters:
      listPostUpdateRequest - is the ListPostUpdateRequest object that contains ListPost 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 PSException
      Gets the post from a specific list for a specific user
      Parameters:
      loginToken - is the login token provided to the user upon sign in
      list_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 PSException
      Adds a post to the favorites list
      Parameters:
      favoriteListAddRequest - is the FavoriteListRequest object that contains ListPost requests parameters
      Returns:
      HttpStatus.CREATED if successful, HttpStatus.CONFLICT OR HttpStatus.BAD_REQUEST otherwise
      Throws:
      PSException
    • DeletePostFromFavoritesList

      @DeleteMapping("/favorite") org.springframework.http.ResponseEntity<?> DeletePostFromFavoritesList​(@RequestBody FavoriteListRequest favoriteListDeleteRequest) throws PSException
      Deletes a post from the favorites list
      Parameters:
      favoriteListDeleteRequest - is the FavoriteListRequest object that contains ListPost requests parameters
      Returns:
      HttpStatus.CREATED if successful, HttpStatus.BAD_REQUEST otherwise
      Throws:
      PSException