Subversion Repositories SmartDukaan

Rev

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

Rev 3830 Rev 4494
Line 9... Line 9...
9
import in.shop2020.model.v1.user.UserContextService.Client;
9
import in.shop2020.model.v1.user.UserContextService.Client;
10
import in.shop2020.serving.cache.EhcacheWrapper;
10
import in.shop2020.serving.cache.EhcacheWrapper;
11
import in.shop2020.serving.services.ContentServingService;
11
import in.shop2020.serving.services.ContentServingService;
12
import in.shop2020.serving.utils.SnippetType;
12
import in.shop2020.serving.utils.SnippetType;
13
import in.shop2020.thrift.clients.CatalogClient;
13
import in.shop2020.thrift.clients.CatalogClient;
-
 
14
import in.shop2020.thrift.clients.PromotionClient;
14
import in.shop2020.thrift.clients.UserClient;
15
import in.shop2020.thrift.clients.UserClient;
15
import in.shop2020.utils.DataLogger;
16
import in.shop2020.utils.DataLogger;
16
 
17
 
17
import java.io.IOException;
18
import java.io.IOException;
18
import java.util.HashMap;
19
import java.util.HashMap;
Line 51... Line 52...
51
	private String id;
52
	private String id;
52
	private String redirectUrl;
53
	private String redirectUrl;
53
	private long productId;
54
	private long productId;
54
	private boolean isMobile = false;
55
	private boolean isMobile = false;
55
	
56
	
-
 
57
	private Map<String, Double> discounts = null;
56
	private Map<String, String> snippets;
58
	private Map<String, String> snippets;
57
	
59
	
58
	public EntityController(){
60
	public EntityController(){
59
		super();
61
		super();
60
	}
62
	}
Line 145... Line 147...
145
			}
147
			}
146
		
148
		
147
		} catch (Exception e) {
149
		} catch (Exception e) {
148
			log.warn("Unable to update the browsing history because of: ", e);
150
			log.warn("Unable to update the browsing history because of: ", e);
149
		}
151
		}
-
 
152
		
-
 
153
		try	{
-
 
154
			PromotionClient promotionServiceClient = new PromotionClient();
-
 
155
			in.shop2020.model.v1.user.PromotionService.Client promotionClient = promotionServiceClient.getClient();
-
 
156
			
-
 
157
			discounts = promotionClient.getDiscountsForEntity(productId);
-
 
158
			
-
 
159
		} catch (Exception e) {
-
 
160
			log.error("Unable to retrieve discounts", e);
-
 
161
		}
150
    	
162
    	
151
		DataLogger.logData(EventType.PRODUCT_VIEW, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
163
		DataLogger.logData(EventType.PRODUCT_VIEW, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
152
                productName, Long.toString(productId));
164
                productName, Long.toString(productId));
153
		return "show";
165
		return "show";
154
    }
166
    }
Line 253... Line 265...
253
            }
265
            }
254
            return;
266
            return;
255
        }
267
        }
256
        log.info("Loaded from cache product snippet for :" + productId);
268
        log.info("Loaded from cache product snippet for :" + productId);
257
    }
269
    }
258
 
270
    
-
 
271
    public Map<String, Double> getDiscounts()	{
-
 
272
    	return discounts;
-
 
273
    }
259
}
274
}
260
275