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 Details

    • patreonCampaignsRepository

      @Autowired PatreonCampaignsRepository patreonCampaignsRepository
      An autowired Spring repository that handles all database CRUD operations with the creator pages
    • webAccountFunctions

      @Autowired WebAccountFunctions webAccountFunctions
      An autowired Spring component that endpoints utilize to send or receive data from the database
    • objectMapper

      @Autowired com.fasterxml.jackson.databind.ObjectMapper objectMapper
      Jackson object mapper that allows converting Java type Object to custom POJOs.
  • Constructor Details

    • PatreonCampaignsFunctions

      public PatreonCampaignsFunctions()
  • Method Details

    • getCampaignByWebaccountId

      public PatreonCampaign getCampaignByWebaccountId​(java.lang.Long id)
      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

      public void getCampaign​(java.lang.Long id) throws PSException
      Throws:
      PSException
    • putCampaign

      public void putCampaign​(java.lang.String loginToken, PatreonDataArrayEntryV2 campaign) throws PSException
      wrapper for putting a PatreonCampaign object into the database
      Parameters:
      loginToken - the user's login token
      campaign - 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 PSException
      puts a PatreonCampaign object into the database
      Parameters:
      webAccount - is the user's WebAccount object
      campaignDataEntry - 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