| Line 11... |
Line 11... |
| 11 |
import org.apache.struts2.rest.DefaultHttpHeaders;
|
11 |
import org.apache.struts2.rest.DefaultHttpHeaders;
|
| 12 |
import org.apache.struts2.rest.HttpHeaders;
|
12 |
import org.apache.struts2.rest.HttpHeaders;
|
| 13 |
import org.apache.thrift.TException;
|
13 |
import org.apache.thrift.TException;
|
| 14 |
|
14 |
|
| 15 |
import in.shop2020.model.v1.user.AuthenticationException;
|
15 |
import in.shop2020.model.v1.user.AuthenticationException;
|
| - |
|
16 |
import in.shop2020.model.v1.user.ShoppingCartException;
|
| 16 |
import in.shop2020.model.v1.user.User;
|
17 |
import in.shop2020.model.v1.user.User;
|
| 17 |
import in.shop2020.model.v1.user.UserContextException;
|
18 |
import in.shop2020.model.v1.user.UserContextException;
|
| 18 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
19 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
| 19 |
import in.shop2020.serving.utils.Utils;
|
20 |
import in.shop2020.serving.utils.Utils;
|
| 20 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
21 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| Line 73... |
Line 74... |
| 73 |
userinfo.setEmail(userEmail);
|
74 |
userinfo.setEmail(userEmail);
|
| 74 |
userinfo.setNameOfUser(user.getName());
|
75 |
userinfo.setNameOfUser(user.getName());
|
| 75 |
this.nameOfUser = user.getName();
|
76 |
this.nameOfUser = user.getName();
|
| 76 |
c.mergeCart(userinfo.getCartId(), user.getActiveCartId());
|
77 |
c.mergeCart(userinfo.getCartId(), user.getActiveCartId());
|
| 77 |
userinfo.setCartId(user.getActiveCartId());
|
78 |
userinfo.setCartId(user.getActiveCartId());
|
| 78 |
userinfo.setTotalItems(Utils.getNumberOfItemsInCart(userinfo.getCartId()));
|
79 |
int totalItems = c.getCart(user.getActiveCartId()).getLinesSize();
|
| - |
|
80 |
userinfo.setTotalItems(totalItems);
|
| 79 |
|
81 |
|
| 80 |
this.session.setAttribute("userinfo", userinfo);
|
82 |
this.session.setAttribute("userinfo", userinfo);
|
| 81 |
|
83 |
|
| 82 |
return new DefaultHttpHeaders("lsuccess");
|
84 |
return new DefaultHttpHeaders("lsuccess");
|
| 83 |
}
|
85 |
}
|
| Line 92... |
Line 94... |
| 92 |
log.error("Exception number is: " + errorCode + "Exception message is:" + errorMessage);
|
94 |
log.error("Exception number is: " + errorCode + "Exception message is:" + errorMessage);
|
| 93 |
} catch (UserContextException e) {
|
95 |
} catch (UserContextException e) {
|
| 94 |
errorCode = e.getErrorCode();
|
96 |
errorCode = e.getErrorCode();
|
| 95 |
e.printStackTrace();
|
97 |
e.printStackTrace();
|
| 96 |
log.error("Exception number is: " + errorCode + "Exception message is:" + errorMessage);
|
98 |
log.error("Exception number is: " + errorCode + "Exception message is:" + errorMessage);
|
| - |
|
99 |
} catch (ShoppingCartException e) {
|
| - |
|
100 |
// TODO Auto-generated catch block
|
| - |
|
101 |
e.printStackTrace();
|
| 97 |
}
|
102 |
}
|
| 98 |
return new DefaultHttpHeaders("lfail");
|
103 |
return new DefaultHttpHeaders("lfail");
|
| 99 |
}
|
104 |
}
|
| 100 |
|
105 |
|
| 101 |
public int getErrorCode() {
|
106 |
public int getErrorCode() {
|