Package com.patreonshout.jpa
Class PatreonCampaignsFunctions
java.lang.Object
com.patreonshout.jpa.PatreonCampaignsFunctions
@Component
public class PatreonCampaignsFunctions
extends java.lang.Object
Component that contains functions for
CreatorPage
endpoints that allow interaction with the database-
Field Summary
Fields Modifier and Type Field Description (package private) com.fasterxml.jackson.databind.ObjectMapper
objectMapper
Jackson object mapper that allows converting Java typeObject
to custom POJOs.(package private) PatreonCampaignsRepository
patreonCampaignsRepository
An autowired Spring repository that handles all database CRUD operations with the creator pages(package private) WebAccountFunctions
webAccountFunctions
An autowired Spring component that endpoints utilize to send or receive data from the database -
Constructor Summary
Constructors Constructor Description PatreonCampaignsFunctions()
-
Method Summary
Modifier and Type Method Description void
getCampaign(java.lang.Long id)
PatreonCampaign
getCampaignByWebaccountId(java.lang.Long id)
gets a campaign id by the user's web account idvoid
putCampaign(WebAccount webAccount, PatreonDataArrayEntryV2 campaignDataEntry)
puts aPatreonCampaign
object into the databasevoid
putCampaign(java.lang.String loginToken, PatreonDataArrayEntryV2 campaign)
wrapper for putting aPatreonCampaign
object into the databaseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
patreonCampaignsRepository
An autowired Spring repository that handles all database CRUD operations with the creator pages -
webAccountFunctions
An autowired Spring component that endpoints utilize to send or receive data from the database -
objectMapper
@Autowired com.fasterxml.jackson.databind.ObjectMapper objectMapperJackson object mapper that allows converting Java typeObject
to custom POJOs.
-
-
Constructor Details
-
PatreonCampaignsFunctions
public PatreonCampaignsFunctions()
-
-
Method Details
-
getCampaignByWebaccountId
gets a campaign id by the user's web account id- Parameters:
id
- is the user's web account id- Returns:
- a
PatreonCampaign
object
-
getCampaign
- Throws:
PSException
-
putCampaign
public void putCampaign(java.lang.String loginToken, PatreonDataArrayEntryV2 campaign) throws PSExceptionwrapper for putting aPatreonCampaign
object into the database- Parameters:
loginToken
- the user's login tokencampaign
- the campaign we want to add to the database- Throws:
PSException
- in case there is a problem with the database or a user mismatch
-
putCampaign
public void putCampaign(WebAccount webAccount, PatreonDataArrayEntryV2 campaignDataEntry) throws PSExceptionputs aPatreonCampaign
object into the database- Parameters:
webAccount
- is the user'sWebAccount
objectcampaignDataEntry
- is the information we want to put into the database for a campaign- Throws:
PSException
- in case there is a problem with the database or a user mismatch
-