Subversion Repositories SmartDukaan

Rev

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

Rev 3080 Rev 3126
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.serving.controllers.BaseController;
3
import in.shop2020.serving.controllers.BaseController;
4
import in.shop2020.thrift.clients.CatalogServiceClient;
4
import in.shop2020.thrift.clients.CatalogClient;
5
 
5
 
6
import org.apache.log4j.Logger;
6
import org.apache.log4j.Logger;
7
 
7
 
8
@SuppressWarnings("serial")
8
@SuppressWarnings("serial")
9
public class ProductNotificationController extends BaseController{
9
public class ProductNotificationController extends BaseController{
Line 17... Line 17...
17
	
17
	
18
	 public String create() {
18
	 public String create() {
19
		emailId = this.request.getParameter("emailId");
19
		emailId = this.request.getParameter("emailId");
20
		itemId = Long.parseLong(this.request.getParameter("itemId"));
20
		itemId = Long.parseLong(this.request.getParameter("itemId"));
21
 
21
 
22
        CatalogServiceClient catalogClientService;
22
        CatalogClient catalogClientService;
23
		try {
23
		try {
24
			catalogClientService = new CatalogServiceClient();
24
			catalogClientService = new CatalogClient();
25
			in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
25
			in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
26
			client.addProductNotification(itemId, emailId);
26
			client.addProductNotification(itemId, emailId);
27
		} catch (Exception e) {
27
		} catch (Exception e) {
28
			log.error("Exception while adding product notification for item: " + itemId + " and email: " + emailId, e);
28
			log.error("Exception while adding product notification for item: " + itemId + " and email: " + emailId, e);
29
		}
29
		}