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.ObjectMapperobjectMapperJackson object mapper that allows converting Java typeObjectto custom POJOs.(package private) PatreonCampaignsRepositorypatreonCampaignsRepositoryAn autowired Spring repository that handles all database CRUD operations with the creator pages(package private) WebAccountFunctionswebAccountFunctionsAn 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 voidgetCampaign(java.lang.Long id)PatreonCampaigngetCampaignByWebaccountId(java.lang.Long id)gets a campaign id by the user's web account idvoidputCampaign(WebAccount webAccount, PatreonDataArrayEntryV2 campaignDataEntry)puts aPatreonCampaignobject into the databasevoidputCampaign(java.lang.String loginToken, PatreonDataArrayEntryV2 campaign)wrapper for putting aPatreonCampaignobject 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 typeObjectto 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
PatreonCampaignobject
-
getCampaign
- Throws:
PSException
-
putCampaign
public void putCampaign(java.lang.String loginToken, PatreonDataArrayEntryV2 campaign) throws PSExceptionwrapper for putting aPatreonCampaignobject 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 aPatreonCampaignobject into the database- Parameters:
webAccount- is the user'sWebAccountobjectcampaignDataEntry- 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
-