Package com.patreonshout.rest
Class SearchFilterSvc
java.lang.Object
com.patreonshout.rest.BaseSvc
com.patreonshout.rest.SearchFilterSvc
- All Implemented Interfaces:
SearchFilterImpl
@RestController public class SearchFilterSvc extends BaseSvc implements SearchFilterImpl
SearchFilter RESTful Endpoint Interface
-
Field Summary
Fields Modifier and Type Field Description private SearchFiltersRepository
searchFiltersRepository
An autowired Spring component that endpoints utilize to send or receive data from the search_filters 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 SearchFilterSvc()
-
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<?>
AddFilter(FilterAddRequest filterAddRequest)
Endpoint that will add a newSearchFilter
to the database for a userorg.springframework.http.ResponseEntity<?>
DeleteFilter(FilterDeleteRequest filterDeleteRequest)
Endpoint that will delete aSearchFilter
object from the database for a userorg.springframework.http.ResponseEntity<?>
GetUserFilters(java.lang.String loginToken)
Endpoint that will get everySearchFilter
from the database for a userMethods 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
-
webAccountFunctions
An autowired Spring component that endpoints utilize to send or receive data from the database -
searchFiltersRepository
An autowired Spring component that endpoints utilize to send or receive data from the search_filters table in the database
-
-
Constructor Details
-
SearchFilterSvc
public SearchFilterSvc()
-
-
Method Details
-
DeleteFilter
public org.springframework.http.ResponseEntity<?> DeleteFilter(FilterDeleteRequest filterDeleteRequest) throws PSExceptionEndpoint that will delete aSearchFilter
object from the database for a user- Specified by:
DeleteFilter
in interfaceSearchFilterImpl
- Parameters:
filterDeleteRequest
- is theFilterDeleteRequest
object that contains json body information about the list we are going to delete from the database- Returns:
HttpStatus.OK
if successful,HttpStatus.BAD_REQUEST
otherwise- Throws:
PSException
-
GetUserFilters
public org.springframework.http.ResponseEntity<?> GetUserFilters(java.lang.String loginToken) throws PSExceptionEndpoint that will get everySearchFilter
from the database for a user- Specified by:
GetUserFilters
in interfaceSearchFilterImpl
- Parameters:
loginToken
- is the login token provided to the user upon sign in- Returns:
- a json body of search filter objects for a user
- Throws:
PSException
-
AddFilter
public org.springframework.http.ResponseEntity<?> AddFilter(FilterAddRequest filterAddRequest) throws PSExceptionEndpoint that will add a newSearchFilter
to the database for a user- Specified by:
AddFilter
in interfaceSearchFilterImpl
- Parameters:
filterAddRequest
- is theFilterAddRequest
object that contains json body information about the list we are going to add to the database- Returns:
HttpStatus.CREATED
if successful,HttpStatus.CONFLICT
otherwise- Throws:
PSException
-