#37 Added eBay Data Source + Docs

This commit is contained in:
Marvin Scham
2023-05-31 13:47:29 +02:00
parent 2f1bd4407c
commit 98d0ee1a8e
5 changed files with 121 additions and 6 deletions

View File

@@ -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);
}