| Line 52... |
Line 52... |
| 52 |
}
|
52 |
}
|
| 53 |
|
53 |
|
| 54 |
// GET /index
|
54 |
// GET /index
|
| 55 |
public HttpHeaders index() throws Exception {
|
55 |
public HttpHeaders index() throws Exception {
|
| 56 |
in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
|
56 |
in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
|
| 57 |
this.setTotalItems(client.totalBestDeals());
|
57 |
this.setTotalItems(client.getBestDealsCount());
|
| 58 |
this.items = client.getBestDeals(beginIndex, windowSize);
|
58 |
this.items = client.getBestDealsCatalogIds(beginIndex, windowSize);
|
| 59 |
return new DefaultHttpHeaders("index");
|
59 |
return new DefaultHttpHeaders("index");
|
| 60 |
}
|
60 |
}
|
| 61 |
|
61 |
|
| 62 |
// GET /show
|
62 |
// GET /show
|
| 63 |
public HttpHeaders show() {
|
63 |
public HttpHeaders show() {
|
| 64 |
in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
|
64 |
in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
|
| 65 |
try {
|
65 |
try {
|
| 66 |
this.setTotalItems(client.totalBestDeals());
|
66 |
this.setTotalItems(client.getBestDealsCount());
|
| 67 |
this.items = client.getBestDeals(beginIndex, windowSize);
|
67 |
this.items = client.getBestDealsCatalogIds(beginIndex, windowSize);
|
| 68 |
} catch (InventoryServiceException e) {
|
68 |
} catch (InventoryServiceException e) {
|
| 69 |
log.error("Unable to get best deals from inventory service.");
|
69 |
log.error("Unable to get best deals from inventory service.");
|
| 70 |
log.error("Exception id is:" + e.getId() + " Exception message is:" + e.getMessage());
|
70 |
log.error("Exception id is:" + e.getId() + " Exception message is:" + e.getMessage());
|
| 71 |
e.printStackTrace();
|
71 |
e.printStackTrace();
|
| 72 |
} catch (TException e) {
|
72 |
} catch (TException e) {
|