Subversion Repositories SmartDukaan

Rev

Rev 15184 | Rev 15230 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15184 Rev 15186
Line 38... Line 38...
38
	public String latestPriceById(){
38
	public String latestPriceById(){
39
		log.info("Inside lastestPriceById");
39
		log.info("Inside lastestPriceById");
40
		log.info("Id is "+id);
40
		log.info("Id is "+id);
41
		log.info("Source id "+source_id);
41
		log.info("Source id "+source_id);
42
		log.info("Encoded Url is "+url);
42
		log.info("Encoded Url is "+url);
43
		
43
 
44
		Client dc = null;
44
		Client dc = null;
-
 
45
		UserMessagePojo ump = new UserMessagePojo();
-
 
46
		ump.setMessage("");
-
 
47
		ump.setResult(false);
45
		try {
48
		try {
46
			dc = new DtrClient().getClient();
49
			dc = new DtrClient().getClient();
47
			dc.updateLatestPriceForItem(Long.valueOf(id));
50
			dc.updateLatestPriceForItem(Long.valueOf(id));
48
			if (Long.valueOf(source_id) == 3){
51
			if (Long.valueOf(source_id) == 3){
49
				SnapdealProductPageParserController spp = new SnapdealProductPageParserController();
52
				SnapdealProductPageParserController spp = new SnapdealProductPageParserController();
50
				spp.setUrl(url);
53
				spp.setUrl(url);
51
				spp.getColorMessage();
54
				setResultJson(spp.getColorMessage());
52
			}
55
			}
53
			else{
56
			else{
54
				UserMessagePojo ump = new UserMessagePojo();
-
 
55
				ump.setMessage("");
-
 
56
				ump.setResult(false);
-
 
57
				setResultJson(ump);
57
				throw new Exception();
58
			}
58
			}
59
		} catch (Exception e) {
59
		} catch (Exception e) {
60
			log.info(e);
60
			setResultJson(ump);
61
		}
61
		}
62
		return "index";
62
		return "index";
63
 
-
 
64
	}
63
	}
65
 
64
 
66
	public String getSkuBundleId() {
65
	public String getSkuBundleId() {
67
		return skuBundleId;
66
		return skuBundleId;
68
	}
67
	}
Line 97... Line 96...
97
	}
96
	}
98
 
97
 
99
	public static void main (String[] args){
98
	public static void main (String[] args){
100
		LivePricingController live = new LivePricingController();
99
		LivePricingController live = new LivePricingController();
101
		live.setId("84");
100
		live.setId("84");
-
 
101
		live.setUrl("aHR0cDovL20uc25hcGRlYWwuY29tL3Byb2R1Y3Qvc3BpY2UtYm9zcy1lbnRlcnRhaW5lci0zLW01NDA2LzEwNTA2ODk2MjM/c3VwYz1TREw3MDA0MzYzMTUmdXRtX3NvdXJjZT1hZmZfcHJvZyZ1dG1fY2FtcGFpZ249YWZ0cyZvZmZlcl9pZD0xNyZhZmZfaWQ9MTc5MTUmYWZmX3N1Yj1TSEEzMTQzMTY3NzM0NQ==");
-
 
102
		live.setSource_id("4");
102
		live.latestPriceById();
103
		live.latestPriceById();
103
		System.out.println(live.getResultJson());
104
		System.out.println(live.getResultJson());
104
	}
105
	}
105
 
106
 
106
 
107