Created
October 17, 2016 01:42
-
-
Save levymoreira/0fe6a387960dd532a5aee1892c0def9b to your computer and use it in GitHub Desktop.
sdf234
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dluxdays.service.csv; | |
import com.dluxdays.service.util.OfferCSVDTO; | |
import com.dluxdays.service.util.OfferCSVDTOBuilder; | |
import com.dluxdays.web.rest.CSVResource; | |
import org.springframework.stereotype.Service; | |
import org.springframework.transaction.annotation.Transactional; | |
import java.util.HashMap; | |
import java.util.Map; | |
@Service | |
@Transactional | |
public class MonnierUpdater extends Updater { | |
public Map<String, String> getDownloadConfiguration() { | |
Map config = new HashMap(); | |
config.put("URL", "http://datatransfer.cj.com/datatransfer/files/4756211/outgoing/productcatalog/190452/Monnier_Frères_UK-Product_Catalog.txt.gz"); | |
config.put("user", "4756211"); | |
config.put("password", "ozMD_ZQY"); | |
return config; | |
} | |
public OfferCSVDTO convertToOfferCSVDTO(String[] params) throws Exception{ | |
return new OfferCSVDTOBuilder() | |
.setMerchantProductId(this.getMerchantProductIdPrefix() + "_" + params[7]) | |
.setOfferUrl(params[17]) | |
.setImagePath(params[19]) | |
.setPrice(params[14]) | |
.setDescription(params[6]) | |
.setProductName(params[4]) | |
.setTagline(params[4]) | |
.setBrandName(params[8]) | |
.setPreviousPrice(params[15]) | |
.setCategoryName(params[20]) | |
.setGender("f") | |
.createOfferCSVDTO(); | |
} | |
public Long getMerchantId() { | |
return CSVResource.ESCADA_ID; | |
} | |
public Long getCurrencyExchangeId() { | |
return CSVResource.GBP_CURRENCY_ID; | |
} | |
public String getMerchantProductIdPrefix() { | |
return CSVResource.ESCADA; | |
} | |
public char getPropertySeparator() { | |
return ','; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment