#37 Added eBay Data Source + Docs
This commit is contained in:
@@ -6,6 +6,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import de.rwu.easydrop.api.client.AmazonProductDataSource;
|
||||
import de.rwu.easydrop.api.client.EbayItemDataSource;
|
||||
import de.rwu.easydrop.util.Config;
|
||||
|
||||
/**
|
||||
@@ -34,14 +35,22 @@ public final class Main {
|
||||
public static void main(final String[] args) throws ConfigurationException {
|
||||
Config config = Config.getInstance();
|
||||
config.loadConfig();
|
||||
|
||||
String amznBaseUrl = config.getProperty("AMAZON_API_URL");
|
||||
String amznApiKey = config.getProperty("AMAZON_API_KEY");
|
||||
String testProduct = null;
|
||||
String ebayBaseUrl = config.getProperty("EBAY_API_URL");
|
||||
String ebayApiKey = config.getProperty("EBAY_API_KEY");
|
||||
|
||||
String amznTestProduct = null;
|
||||
String ebayTestProduct = null;
|
||||
|
||||
AmazonProductDataSource amznSrc = new AmazonProductDataSource(amznBaseUrl, amznApiKey);
|
||||
EbayItemDataSource ebaySrc = new EbayItemDataSource(ebayBaseUrl, ebayApiKey);
|
||||
try {
|
||||
testProduct = amznSrc.getProductDTOById("B096Y2TYKV").toString();
|
||||
LOGGER.info(testProduct);
|
||||
amznTestProduct = amznSrc.getProductDTOById("B096Y2TYKV").toString();
|
||||
LOGGER.info(amznTestProduct);
|
||||
ebayTestProduct = ebaySrc.getProductDTOById("Gigabyte GeForce RTX 3060").toString();
|
||||
LOGGER.info(ebayTestProduct);
|
||||
} catch (IllegalArgumentException e) {
|
||||
LOGGER.error("Something went wrong :(", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user