Subversion Repositories SmartDukaan

Rev

Rev 3126 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3080 rajveer 1
package in.shop2020.serving.controllers;
2
 
3
import in.shop2020.serving.controllers.BaseController;
3126 rajveer 4
import in.shop2020.thrift.clients.CatalogClient;
3080 rajveer 5
 
6
import org.apache.log4j.Logger;
7
 
8
@SuppressWarnings("serial")
9
public class ProductNotificationController extends BaseController{
10
 
11
	private static Logger log = Logger.getLogger(ProductNotificationController.class);
12
	private String emailId = null;
13
	private long itemId = 0;
14
	public ProductNotificationController(){
15
		super();	
16
	}
17
 
18
	 public String create() {
5214 amar.kumar 19
		try {
20
			emailId = this.request.getParameter("emailId");
21
			itemId = Long.parseLong(this.request.getParameter("itemId"));
3080 rajveer 22
 
5214 amar.kumar 23
	        CatalogClient catalogClientService;
3126 rajveer 24
			catalogClientService = new CatalogClient();
3080 rajveer 25
			in.shop2020.model.v1.catalog.InventoryService.Client client = catalogClientService.getClient();
26
			client.addProductNotification(itemId, emailId);
27
		} catch (Exception e) {
28
			log.error("Exception while adding product notification for item: " + itemId + " and email: " + emailId, e);
29
		}
30
		log.debug("Got product notification for product: " + itemId + "  from user: " + emailId );
31
		return "show";
32
	 }
33
 
34
}