| Line 4... |
Line 4... |
| 4 |
package in.shop2020.serving.controllers;
|
4 |
package in.shop2020.serving.controllers;
|
| 5 |
|
5 |
|
| 6 |
import in.shop2020.model.v1.user.Sex;
|
6 |
import in.shop2020.model.v1.user.Sex;
|
| 7 |
import in.shop2020.model.v1.user.User;
|
7 |
import in.shop2020.model.v1.user.User;
|
| 8 |
import in.shop2020.model.v1.user.UserContextException;
|
8 |
import in.shop2020.model.v1.user.UserContextException;
|
| 9 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
9 |
import in.shop2020.thrift.clients.UserClient;
|
| 10 |
|
10 |
|
| 11 |
import java.io.UnsupportedEncodingException;
|
11 |
import java.io.UnsupportedEncodingException;
|
| 12 |
import java.util.HashMap;
|
12 |
import java.util.HashMap;
|
| 13 |
import java.util.Map;
|
13 |
import java.util.Map;
|
| 14 |
|
14 |
|
| Line 81... |
Line 81... |
| 81 |
|
81 |
|
| 82 |
private boolean updatePersonalDetails(long userId, String name, String phone, String dateOfBirth, String sex, String communicationEmail,
|
82 |
private boolean updatePersonalDetails(long userId, String name, String phone, String dateOfBirth, String sex, String communicationEmail,
|
| 83 |
String subscribeNewsletter) {
|
83 |
String subscribeNewsletter) {
|
| 84 |
|
84 |
|
| 85 |
try {
|
85 |
try {
|
| 86 |
UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
|
86 |
UserClient userContextServiceClient = new UserClient();
|
| 87 |
in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
|
87 |
in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
|
| 88 |
|
88 |
|
| 89 |
User user = userClient.getUserById(userId);
|
89 |
User user = userClient.getUserById(userId);
|
| 90 |
user.setDateOfBirth(dateOfBirth);
|
90 |
user.setDateOfBirth(dateOfBirth);
|
| 91 |
user.setName(name);
|
91 |
user.setName(name);
|
| Line 108... |
Line 108... |
| 108 |
}
|
108 |
}
|
| 109 |
return false;
|
109 |
return false;
|
| 110 |
}
|
110 |
}
|
| 111 |
|
111 |
|
| 112 |
public Map<String, String> getVelocityParams(){
|
112 |
public Map<String, String> getVelocityParams(){
|
| 113 |
UserContextServiceClient userContextServiceClient = null;
|
113 |
UserClient userContextServiceClient = null;
|
| 114 |
in.shop2020.model.v1.user.UserContextService.Client userClient = null;
|
114 |
in.shop2020.model.v1.user.UserContextService.Client userClient = null;
|
| 115 |
try{
|
115 |
try{
|
| 116 |
User user = null;
|
116 |
User user = null;
|
| 117 |
userContextServiceClient = new UserContextServiceClient();
|
117 |
userContextServiceClient = new UserClient();
|
| 118 |
userClient = userContextServiceClient.getClient();
|
118 |
userClient = userContextServiceClient.getClient();
|
| 119 |
user = userClient.getUserById(userinfo.getUserId());
|
119 |
user = userClient.getUserById(userinfo.getUserId());
|
| 120 |
|
120 |
|
| 121 |
velocityParams.put("email", user.getCommunicationEmail());
|
121 |
velocityParams.put("email", user.getCommunicationEmail());
|
| 122 |
velocityParams.put("sex", user.getSex().getValue()+"");
|
122 |
velocityParams.put("sex", user.getSex().getValue()+"");
|