Package com.patreonshout.rest.interfaces
Interface WebAccountImpl
- All Known Implementing Classes:
WebAccountSvc
@RequestMapping("/webaccount")
public interface WebAccountImpl
Interface for endpoints relating to webaccount activities
-
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<?>
GetPatreonTokens(java.lang.String loginToken)
Endpoint that allows retrieval of Patreon access and refresh tokens for aWebAccount
containing the given login tokenorg.springframework.http.ResponseEntity<?>
GetSocialIntegration(java.lang.String loginToken)
Endpoint that returns the social integration tokens and webhook URLs for social platforms for a given login tokenorg.springframework.http.ResponseEntity<?>
Login(LoginRequest loginRequest)
Endpoint that will create a newWebAccountFunctions
into the databaseorg.springframework.http.ResponseEntity<?>
Logout(java.lang.String loginToken)
Endpoint that will delete a login token from aWebAccountFunctions
in the databaseorg.springframework.http.HttpStatus
PutSocialIntegration(PutSocialIntegrationRequest putSocialIntegrationRequest)
Endpoint that allows registering, updating or deleting integrations for social platforms.org.springframework.http.HttpStatus
Register(RegisterRequest registerRequest)
Endpoint that will create a newWebAccountFunctions
into the database.org.springframework.http.ResponseEntity<?>
ResetPassword(ResetPasswordRequest resetPasswordRequest)
Endpoint that allowsWebAccount
password resetting.
-
Method Details
-
Register
@PostMapping("/register") org.springframework.http.HttpStatus Register(@RequestBody RegisterRequest registerRequest) throws PSExceptionEndpoint that will create a newWebAccountFunctions
into the database.- Parameters:
registerRequest
-RegisterRequest
object that contains the desired login details for a new- Returns:
HttpStatus.OK
if the registration was successful,HttpStatus.CONFLICT
if the account already exists- Throws:
PSException
-
Login
@PostMapping("/login") org.springframework.http.ResponseEntity<?> Login(@RequestBody LoginRequest loginRequest) throws PSExceptionEndpoint that will create a newWebAccountFunctions
into the database- Parameters:
loginRequest
- is the json request- Returns:
- a token signifying valid login or no token signifying invalid login
- Throws:
PSException
-
Logout
@DeleteMapping("/logout") org.springframework.http.ResponseEntity<?> Logout(@RequestParam(name="login_token") java.lang.String loginToken)Endpoint that will delete a login token from aWebAccountFunctions
in the database- Parameters:
loginToken
- Login token to delete from the database- Returns:
HttpStatus.OK
if successful
-
PutSocialIntegration
@PutMapping("/socialintegration") @ResponseStatus(code=OK, reason="Data saved successfully") org.springframework.http.HttpStatus PutSocialIntegration(@RequestBody PutSocialIntegrationRequest putSocialIntegrationRequest) throws PSExceptionEndpoint that allows registering, updating or deleting integrations for social platforms.- Parameters:
putSocialIntegrationRequest
-PutSocialIntegrationRequest
object that containsWebAccountFunctions
and request details.- Returns:
HttpStatus.OK
if successful,HttpStatus.CONFLICT
if the providedPutSocialIntegrationRequest
does not contain a validWebAccount
ID number.- Throws:
PSException
-
GetSocialIntegration
@GetMapping("/socialintegration") org.springframework.http.ResponseEntity<?> GetSocialIntegration(@RequestParam(name="login_token") java.lang.String loginToken) throws PSExceptionEndpoint that returns the social integration tokens and webhook URLs for social platforms for a given login token- Parameters:
loginToken
- Login token belonging to aWebAccount
- Returns:
SocialIntegration
Social integration tokens and webhook URLs- Throws:
PSException
-
GetPatreonTokens
@GetMapping("/patreontokens") org.springframework.http.ResponseEntity<?> GetPatreonTokens(@RequestParam(name="login_token") java.lang.String loginToken) throws PSExceptionEndpoint that allows retrieval of Patreon access and refresh tokens for aWebAccount
containing the given login token- Parameters:
loginToken
- Login token belonging to aWebAccount
- Returns:
WebAccount
Patreon access and refresh token- Throws:
PSException
-
ResetPassword
@PutMapping("/resetpassword") org.springframework.http.ResponseEntity<?> ResetPassword(@RequestBody ResetPasswordRequest resetPasswordRequest) throws PSExceptionEndpoint that allowsWebAccount
password resetting.- Parameters:
resetPasswordRequest
-ResetPasswordRequest
object generated from a user calling this endpoint- Returns:
HttpStatus.OK
if successful,HttpStatus.UNAUTHORIZED
if the given oldPassword did not match any current passwords belonging to theWebAccount
found with the given loginToken- Throws:
PSException
-