This commit is contained in:
Ubujira 2022-05-13 16:54:32 +02:00
parent b9fb712244
commit e7671fb739
Signed by: Ubujira
GPG Key ID: 0AE21133AB421B0B
1 changed files with 1 additions and 2 deletions

View File

@ -24,8 +24,7 @@ public class GalaxusAPI {
public ProductDetails getProductDetailed(int productId) {
try {
JsonArray json = JsonParser.parseString(doRequest(URL + "/pdp-get-product-details-critical-data-refetch", "[{\"operationName\":\"PDP_GET_PRODUCT_DETAILS_CRITICAL_DATA_REFETCH\",\"variables\":{\"productId\":2352460,\"supplierId\":null,\"secondHandSalesOfferId\":null,\"sectorId\":5},\"query\":\"query PDP_GET_PRODUCT_DETAILS_CRITICAL_DATA_REFETCH($productId: Int!) {\\n productDetails: productDetailsV3(productId: $productId) {\\n mandatorSpecificData {\\n isBestseller\\n isDeleted\\n showroomSites\\n sectorIds\\n }\\n product {\\n id\\n productId\\n name\\n nameProperties\\n productTypeId\\n productTypeName\\n brandId\\n brandName\\n averageRating\\n totalRatings\\n totalQuestions\\n isProductSet\\n images {\\n url\\n height\\n width\\n }\\n energyEfficiency {\\n energyEfficiencyColorType\\n energyEfficiencyLabelText\\n energyEfficiencyLabelSigns\\n energyEfficiencyImage {\\n url\\n height\\n width\\n }\\n }\\n seo {\\n seoProductTypeName\\n seoNameProperties\\n productGroups {\\n productGroup1\\n productGroup2\\n productGroup3\\n productGroup4\\n __typename\\n }\\n __typename\\n }\\n hasVariants\\n __typename\\n }\\n offers {\\n ...ProductDetailsOffer\\n __typename\\n }\\n __typename\\n }\\n}\\n\\nfragment ProductDetailsOffer on ProductDetailOffer {\\n id\\n productId\\n offerId\\n shopOfferId\\n price {\\n amountIncl\\n amountExcl\\n currency\\n fraction\\n __typename\\n }\\n deliveryOptions {\\n mail {\\n classification\\n futureReleaseDate\\n __typename\\n }\\n pickup {\\n siteId\\n classification\\n futureReleaseDate\\n __typename\\n }\\n detailsProvider {\\n productId\\n offerId\\n quantity\\n type\\n __typename\\n }\\n __typename\\n }\\n supplier {\\n name\\n countryIsoCode\\n countryName\\n customsType\\n link\\n __typename\\n }\\n label\\n type\\n volumeDiscountPrices {\\n minAmount\\n price {\\n amountIncl\\n amountExcl\\n currency\\n __typename\\n }\\n isDefault\\n __typename\\n }\\n salesInformation {\\n numberOfItems\\n numberOfItemsSold\\n isEndingSoon\\n __typename\\n }\\n incentiveText\\n isIncentiveCashback\\n isNew\\n isSalesPromotion\\n hideInProductDiscovery\\n canAddToBasket\\n hidePrice\\n insteadOfPrice {\\n type\\n price {\\n amountIncl\\n amountExcl\\n currency\\n fraction\\n __typename\\n }\\n __typename\\n }\\n minOrderQuantity\\n secondHandOfferInfo {\\n conditions {\\n name\\n value\\n description\\n __typename\\n }\\n generalCondition {\\n name\\n value\\n description\\n __typename\\n }\\n description\\n sellerCustomerId\\n images {\\n fileUrl\\n description\\n width\\n height\\n __typename\\n }\\n warranty {\\n title\\n description\\n tooltip\\n isSpecificWarranty\\n __typename\\n }\\n __typename\\n }\\n returnText {\\n title\\n description\\n __typename\\n }\\n warrantyOverviews {\\n title\\n description\\n __typename\\n }\\n digitecConnect {\\n months\\n value\\n type\\n __typename\\n }\\n specifications {\\n title\\n description\\n link\\n type\\n properties {\\n name\\n propertyId\\n description\\n descriptionLink\\n type\\n values {\\n value\\n description\\n descriptionLink\\n link\\n propertyDefinitionOptionId\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n}\\n\"}]").body().string()).getAsJsonArray();
System.out.println(json);
JsonArray json = JsonParser.parseString(doRequest(URL + "/pdp-get-product-details-critical-data-refetch", "[{\"operationName\":\"PDP_GET_PRODUCT_DETAILS_CRITICAL_DATA_REFETCH\",\"variables\":{\"productId\":" + productId + ",\"supplierId\":null,\"secondHandSalesOfferId\":null,\"sectorId\":5},\"query\":\"query PDP_GET_PRODUCT_DETAILS_CRITICAL_DATA_REFETCH($productId: Int!) {\\n productDetails: productDetailsV3(productId: $productId) {\\n mandatorSpecificData {\\n isBestseller\\n isDeleted\\n showroomSites\\n sectorIds\\n }\\n product {\\n id\\n productId\\n name\\n nameProperties\\n productTypeId\\n productTypeName\\n brandId\\n brandName\\n averageRating\\n totalRatings\\n totalQuestions\\n isProductSet\\n images {\\n url\\n height\\n width\\n }\\n energyEfficiency {\\n energyEfficiencyColorType\\n energyEfficiencyLabelText\\n energyEfficiencyLabelSigns\\n energyEfficiencyImage {\\n url\\n height\\n width\\n }\\n }\\n seo {\\n seoProductTypeName\\n seoNameProperties\\n productGroups {\\n productGroup1\\n productGroup2\\n productGroup3\\n productGroup4\\n __typename\\n }\\n __typename\\n }\\n hasVariants\\n __typename\\n }\\n offers {\\n ...ProductDetailsOffer\\n __typename\\n }\\n __typename\\n }\\n}\\n\\nfragment ProductDetailsOffer on ProductDetailOffer {\\n id\\n productId\\n offerId\\n shopOfferId\\n price {\\n amountIncl\\n amountExcl\\n currency\\n fraction\\n __typename\\n }\\n deliveryOptions {\\n mail {\\n classification\\n futureReleaseDate\\n __typename\\n }\\n pickup {\\n siteId\\n classification\\n futureReleaseDate\\n __typename\\n }\\n detailsProvider {\\n productId\\n offerId\\n quantity\\n type\\n __typename\\n }\\n __typename\\n }\\n supplier {\\n name\\n countryIsoCode\\n countryName\\n customsType\\n link\\n __typename\\n }\\n label\\n type\\n volumeDiscountPrices {\\n minAmount\\n price {\\n amountIncl\\n amountExcl\\n currency\\n __typename\\n }\\n isDefault\\n __typename\\n }\\n salesInformation {\\n numberOfItems\\n numberOfItemsSold\\n isEndingSoon\\n __typename\\n }\\n incentiveText\\n isIncentiveCashback\\n isNew\\n isSalesPromotion\\n hideInProductDiscovery\\n canAddToBasket\\n hidePrice\\n insteadOfPrice {\\n type\\n price {\\n amountIncl\\n amountExcl\\n currency\\n fraction\\n __typename\\n }\\n __typename\\n }\\n minOrderQuantity\\n secondHandOfferInfo {\\n conditions {\\n name\\n value\\n description\\n __typename\\n }\\n generalCondition {\\n name\\n value\\n description\\n __typename\\n }\\n description\\n sellerCustomerId\\n images {\\n fileUrl\\n description\\n width\\n height\\n __typename\\n }\\n warranty {\\n title\\n description\\n tooltip\\n isSpecificWarranty\\n __typename\\n }\\n __typename\\n }\\n returnText {\\n title\\n description\\n __typename\\n }\\n warrantyOverviews {\\n title\\n description\\n __typename\\n }\\n digitecConnect {\\n months\\n value\\n type\\n __typename\\n }\\n specifications {\\n title\\n description\\n link\\n type\\n properties {\\n name\\n propertyId\\n description\\n descriptionLink\\n type\\n values {\\n value\\n description\\n descriptionLink\\n link\\n propertyDefinitionOptionId\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n}\\n\"}]").body().string()).getAsJsonArray();
return new ProductDetails(json);
} catch (IOException e) {
e.printStackTrace();