| Line 59... |
Line 59... |
| 59 |
import in.shop2020.serving.page.ShoppingCartPage;
|
59 |
import in.shop2020.serving.page.ShoppingCartPage;
|
| 60 |
import in.shop2020.serving.utils.*;
|
60 |
import in.shop2020.serving.utils.*;
|
| 61 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
61 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
| 62 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
62 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
| 63 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
63 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| 64 |
import in.shop2020.thrift.clients.WidgetServiceClient;
|
- |
|
| 65 |
|
64 |
|
| 66 |
|
65 |
|
| 67 |
public class PageLoaderHandler {
|
66 |
public class PageLoaderHandler {
|
| 68 |
|
67 |
|
| 69 |
public Map<String,String> getProductPage(long productId, Map<String, String> params) throws TException {
|
68 |
public Map<String,String> getProductPage(long productId, Map<String, String> params) throws TException {
|
| Line 263... |
Line 262... |
| 263 |
Client client = null;
|
262 |
Client client = null;
|
| 264 |
|
263 |
|
| 265 |
try {
|
264 |
try {
|
| 266 |
catalogServiceClient = new CatalogServiceClient();
|
265 |
catalogServiceClient = new CatalogServiceClient();
|
| 267 |
client = catalogServiceClient.getClient();
|
266 |
client = catalogServiceClient.getClient();
|
| 268 |
List<Long> items = client.getBestSellersCatalogIds(1, 20);
|
267 |
List<Long> items = client.getBestSellersCatalogIds(1, 20, -1);
|
| 269 |
List<String> itemList = new ArrayList<String>();
|
268 |
List<String> itemList = new ArrayList<String>();
|
| 270 |
for(Long item: items){
|
269 |
for(Long item: items){
|
| 271 |
itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
|
270 |
itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
|
| 272 |
}
|
271 |
}
|
| 273 |
context.put("itemList", itemList);
|
272 |
context.put("itemList", itemList);
|
| Line 291... |
Line 290... |
| 291 |
Client client = null;
|
290 |
Client client = null;
|
| 292 |
|
291 |
|
| 293 |
try {
|
292 |
try {
|
| 294 |
catalogServiceClient = new CatalogServiceClient();
|
293 |
catalogServiceClient = new CatalogServiceClient();
|
| 295 |
client = catalogServiceClient.getClient();
|
294 |
client = catalogServiceClient.getClient();
|
| 296 |
List<Long> items = client.getLatestArrivalsCatalogIds(1,20);
|
295 |
List<Long> items = client.getLatestArrivalsCatalogIds(1, 20, -1);
|
| 297 |
List<String> itemList = new ArrayList<String>();
|
296 |
List<String> itemList = new ArrayList<String>();
|
| 298 |
for(Long item: items){
|
297 |
for(Long item: items){
|
| 299 |
itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
|
298 |
itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
|
| 300 |
}
|
299 |
}
|
| 301 |
context.put("itemList", itemList);
|
300 |
context.put("itemList", itemList);
|
| Line 319... |
Line 318... |
| 319 |
Client client = null;
|
318 |
Client client = null;
|
| 320 |
|
319 |
|
| 321 |
try {
|
320 |
try {
|
| 322 |
catalogServiceClient = new CatalogServiceClient();
|
321 |
catalogServiceClient = new CatalogServiceClient();
|
| 323 |
client = catalogServiceClient.getClient();
|
322 |
client = catalogServiceClient.getClient();
|
| 324 |
List<Long> items = client.getBestDealsCatalogIds(1,20);
|
323 |
List<Long> items = client.getBestDealsCatalogIds(1, 20, -1);
|
| 325 |
List<String> itemList = new ArrayList<String>();
|
324 |
List<String> itemList = new ArrayList<String>();
|
| 326 |
for(Long item: items){
|
325 |
for(Long item: items){
|
| 327 |
itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
|
326 |
itemList.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"HomeSnippet.html"));
|
| 328 |
}
|
327 |
}
|
| 329 |
context.put("itemList", itemList);
|
328 |
context.put("itemList", itemList);
|