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 SearchFiltersRepositorysearchFiltersRepositoryAn autowired Spring component that endpoints utilize to send or receive data from the search_filters table in the databaseprivate WebAccountFunctionswebAccountFunctionsAn 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 newSearchFilterto the database for a userorg.springframework.http.ResponseEntity<?>DeleteFilter(FilterDeleteRequest filterDeleteRequest)Endpoint that will delete aSearchFilterobject from the database for a userorg.springframework.http.ResponseEntity<?>GetUserFilters(java.lang.String loginToken)Endpoint that will get everySearchFilterfrom the database for a userMethods 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
-
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 aSearchFilterobject from the database for a user- Specified by:
DeleteFilterin interfaceSearchFilterImpl- Parameters:
filterDeleteRequest- is theFilterDeleteRequestobject that contains json body information about the list we are going to delete from the database- Returns:
HttpStatus.OKif successful,HttpStatus.BAD_REQUESTotherwise- Throws:
PSException
-
GetUserFilters
public org.springframework.http.ResponseEntity<?> GetUserFilters(java.lang.String loginToken) throws PSExceptionEndpoint that will get everySearchFilterfrom the database for a user- Specified by:
GetUserFiltersin 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 newSearchFilterto the database for a user- Specified by:
AddFilterin interfaceSearchFilterImpl- Parameters:
filterAddRequest- is theFilterAddRequestobject that contains json body information about the list we are going to add to the database- Returns:
HttpStatus.CREATEDif successful,HttpStatus.CONFLICTotherwise- Throws:
PSException
-